POST
/invoice/add
This endpoint allows the developer to create an invoice for a specific customer. When creating invoices, please first make sure that the customer exists in SimplePin’s database by calling the getCustomer endpoint. If not, create a new customer with the addCustomer endpoint. After customer existence is validated, check if the invoice is already created with getInvoice. Only if it is not in the system, you can create a new invoice. Please pay specific attention to the main or billing address of the customer. You should always retrieve the country and Province/State using a location controller with getCountries and getProvinces endpoints.
Parameters
Name
Description
addInvoiceModel
(required)
This is the data required in order to create an invoice.
Response Messages
Code
Description
200
OK
201
Created
401
Unauthorized
403
Forbidden
404
Not Found
{
"policy_id": "string",
"period_start_date": "yyyy-MM-dd'T'HH:mm:ss.SSSXXX",
"period_end_date": "yyyy-MM-dd'T'HH:mm:ss.SSSXXX",
"invoice_date": "yyyy-MM-dd'T'HH:mm:ss.SSSXXX",
"invoice_due_date": "yyyy-MM-dd'T'HH:mm:ss.SSSXXX",
"enable_preauthorize": true,
"schedule_date": "yyyy-MM-dd'T'HH:mm:ss.SSSXXX",
"invoice_number": "string",
"invoice_type": {
"id": 0,
"state": "DISABLED",
"name": "string",
"order": 0,
"company_id": 0,
"creation_date": "yyyy-MM-dd'T'HH:mm:ss.SSSXXX"
},
"additional_desr": "string",
"locale": "string",
"line_items_list": [
{
"description": "string",
"order": 0,
"quantity": 1.01,
"unit_price": 1.01,
"taxable": true
}
],
"subtotal": 1.01,
"taxation_models": [
{
"amount": 1.01,
"id": 0,
"percent": 1.01,
"registration_number": "string",
"version": 0,
"company_id": 0,
"label": "string",
"percentage": 1.01,
"value": 1.01,
"order": 0,
"reg_number": "string",
"enabled": true
}
],
"total": 1.01,
"state": "DRAFT",
"currency_code": "AED",
"admin_fees_models": [
{
"customer_fee_percent": 1.01,
"payment_method": "CREDIT_CARD"
}
],
"billing_address_id": 0,
"sent": true,
"delete_line_item_models": {
"id": []
}
}
{ } AddInvoiceModel
policy_id
optional
string
period_start_date
optional
string
period_end_date
optional
string
invoice_date
optional
string
invoice_due_date
optional
string
enable_preauthorize
optional
boolean
schedule_date
optional
string
invoice_number
optional
string
additional_desr
optional
string
locale
optional
string
subtotal
optional
number
total
optional
number
state
optional
string
currency_code
optional
string
billing_address_id
optional
integer
sent
optional
boolean
{ } InvoiceTypeModel
id
optional
integer
state
optional
string
name
optional
string
order
optional
integer
company_id
optional
integer
creation_date
optional
string
{ } NewLineItemModel
description
optional
string
order
optional
integer
quantity
optional
number
unit_price
optional
number
taxable
optional
boolean
{ } TaxationModel
amount
optional
number
id
optional
integer
percent
optional
number
registration_number
optional
string
version
optional
integer
company_id
optional
integer
label
optional
string
percentage
optional
number
value
optional
number
order
optional
integer
reg_number
optional
string
enabled
optional
boolean
{ } AdminFeesModel
customer_fee_percent
optional
number
payment_method
optional
string
{ } DeleteLineItemModel
id
optional
array
{
"url": "string",
"uuid": "string"
}
{ } AddInvoiceResultModel
url
required
string
uuid
required
string
<add_invoice_model>
<policy_id>string</policy_id>
<period_start_date>yyyy-MM-dd'T'HH:mm:ss.SSSXXX</period_start_date>
<period_end_date>yyyy-MM-dd'T'HH:mm:ss.SSSXXX</period_end_date>
<invoice_date>yyyy-MM-dd'T'HH:mm:ss.SSSXXX</invoice_date>
<invoice_due_date>yyyy-MM-dd'T'HH:mm:ss.SSSXXX</invoice_due_date>
<enable_preauthorize>1</enable_preauthorize>
<schedule_date>yyyy-MM-dd'T'HH:mm:ss.SSSXXX</schedule_date>
<invoice_number>string</invoice_number>
<invoice_type/>
<additional_desr>string</additional_desr>
<locale>string</locale>
<line_items_list>
<description>string</description>
<order>0</order>
<quantity>1.01</quantity>
<unit_price>1.01</unit_price>
<taxable>1</taxable>
</line_items_list>
<line_items_list>
<description>string</description>
<order>0</order>
<quantity>1.01</quantity>
<unit_price>1.01</unit_price>
<taxable>1</taxable>
</line_items_list>
<subtotal>1.01</subtotal>
<taxation_model>
<amount>1.01</amount>
<id>0</id>
<percent>1.01</percent>
<registration_number>string</registration_number>
<version>0</version>
<company_id>0</company_id>
<label>string</label>
<percentage>1.01</percentage>
<value>1.01</value>
<order>0</order>
<reg_number>string</reg_number>
<enabled>1</enabled>
</taxation_model>
<taxation_model>
<amount>1.01</amount>
<id>0</id>
<percent>1.01</percent>
<registration_number>string</registration_number>
<version>0</version>
<company_id>0</company_id>
<label>string</label>
<percentage>1.01</percentage>
<value>1.01</value>
<order>0</order>
<reg_number>string</reg_number>
<enabled>1</enabled>
</taxation_model>
<total>1.01</total>
<state>DRAFT</state>
<currency_code>AED</currency_code>
<admin_fees_model>
<customer_fee_percent>1.01</customer_fee_percent>
<payment_method>CREDIT_CARD</payment_method>
</admin_fees_model>
<admin_fees_model>
<customer_fee_percent>1.01</customer_fee_percent>
<payment_method>CREDIT_CARD</payment_method>
</admin_fees_model>
<billing_address_id>0</billing_address_id>
<sent>1</sent>
<delete_line_item_models/>
</add_invoice_model>
{ } AddInvoiceModel
policy_id
optional
string
period_start_date
optional
string
period_end_date
optional
string
invoice_date
optional
string
invoice_due_date
optional
string
enable_preauthorize
optional
boolean
schedule_date
optional
string
invoice_number
optional
string
additional_desr
optional
string
locale
optional
string
subtotal
optional
number
total
optional
number
state
optional
string
currency_code
optional
string
billing_address_id
optional
integer
sent
optional
boolean
{ } InvoiceTypeModel
id
optional
integer
state
optional
string
name
optional
string
order
optional
integer
company_id
optional
integer
creation_date
optional
string
{ } NewLineItemModel
description
optional
string
order
optional
integer
quantity
optional
number
unit_price
optional
number
taxable
optional
boolean
{ } TaxationModel
amount
optional
number
id
optional
integer
percent
optional
number
registration_number
optional
string
version
optional
integer
company_id
optional
integer
label
optional
string
percentage
optional
number
value
optional
number
order
optional
integer
reg_number
optional
string
enabled
optional
boolean
{ } AdminFeesModel
customer_fee_percent
optional
number
payment_method
optional
string
{ } DeleteLineItemModel
id
optional
array
<add_invoice_result_model>
<url>string</url>
<uuid>string</uuid>
</add_invoice_result_model>
{ } AddInvoiceResultModel
url
required
string
uuid
required
string