Create Invoice
Inbound | POST | /invoice/invoice-pdf
Summary
This API is used to create Invoice PDF.
Description
This API will be used to create the Invoice PDF for the orders for which tax details were already calculated. So, before making this API call, the compute tax details API call would need to be made first with the request param “store” as true.
Request Params
orderCode
shipmentCode
Parameter Name | Data Type | Description | Mandatory |
| String | This is the order code which the tax details were calculated and the invoice PDF needs to be generated. | yes |
| String | This is the shipment code which the tax details were calculated and the invoice PDF needs to be generated. | yes |
Request
{
"billingAddress":{
"city":"Surat",
"country":"India",
"email":"mohit@gmail.com",
"street1":"A-102, Balaji Residency",
"street2":"Motera",
"street3":"",
"firstName":"Mohit",
“middleName”:””,
“lastName”:”Singh”,
"phone":"9121726219",
"state":"Gujarat",
"zip":"394518"
},
"shippingAddress":{
"city":"Surat",
"country":"India",
"email":"mohit@gmail.com",
"street1":"A-102, Balaji Residency",
"street2":"Motera",
"street3":"",
"firstName":"Mohit",
“middleName”:””,
“lastName”:”Singh”,
"phone":"9121726219",
"state":"Gujarat",
"zip":"394518"
},
"fromAddress":{
"city":"Bangalore",
"country":"India",
"email":"ram@gmail.com",
"street1":"Mathalli area",
"street2":"Opposite Ring road",
"street3":"",
"firstName":"Ram",
“middleName”:””,
“lastName”:”Mehta”,
"phone":"8135671272",
"state":"Karnataka",
"zip":"560102"
},
"clientPanNo":"AAAAA1111A",
"currency":"INR",
"fromPartyName":"Puma",
"orderTime":"2021-04-15T05:30:00+05:30",
"timeZone":"Asia/Kolkata",
"toPartyName":"Customer",
"orderType":"SALES",
"internalOrderId":"122334",
“channelOrderId”:”channel-order-23”,
“channelName”:”FLIPKART”,
"invoiceItems":[
{
"lineItemId":1,
"channelSku":"flipkart-sku-2",
"itemName":"Shirt"
,
"orderItemCode":"order-item-1"
,
"styleId":"style-1"
,
"mrp":1200.0
,
"discount":100.0
,
"category":"category 1"
,
"actualSellingPricePerUnit":1100.0
,
"shippingChargePerUnit":0.0
,
"codChargePerUnit":0.0
,
"quantity":1
,
"hsn":"6214"
,
"vendorSku":"client-sku"
,
"taxAmountPerUnit":100.0
,
"taxRate":10.0
,
"subTaxItems":[
{
"type":"IGST"
,
"rate":10.0,
"taxPerUnit":100.0
}
,
{
"type":"SGST"
,
"rate":0.0,
"taxPerUnit":0.0
}
,
{
"type":"CGST"
,
"rate":0.0,
"taxPerUnit":0.0
}
]
,
}
]
}
Parameter Name | Data Type | Description | Mandatory |
| Object | Billing Address of the customer | Yes |
| String | City of customer | Yes |
| String | Country of customer | Yes |
| String | Email of customer | No |
| String | 1st line of customer address | Yes |
| String | 2nd line of customer address | No |
| String | 3rd line of customer address | No |
| String | First Name of customer | Yes |
| String | Middle Name of customer | No |
| String | Last Name of customer | Yes |
| String | Phone number of customer | No |
| String | State of customer | Yes |
| String | Zip/Pin code of customer | Yes |
| Object | Total quantity of a sku for a line item | Yes |
| String | City of customer | Yes |
| String | Country of customer | Yes |
| String | Email of customer | No |
| String | 1st line of customer address | Yes |
| String | 2nd line of customer address | No |
| String | 3rd line of customer address | No |
| String | First Name of customer | Yes |
| String | Middle Name of customer | No |
| String | Last Name of customer | Yes |
| String | Phone Number of customer | No |
| String | State of customer | Yes |
| String | Zip/Pin code of customer | Yes |
| Object | Seller Address | Yes |
| String | City of Seller | Yes |
| String | Country of Seller | Yes |
| String | Email of Seller | No |
| String | 1st line of Seller address | Yes |
| String | 2nd line of Seller address | No |
| String | 3rd line of Seller address | No |
| String | First Name of Seller | Yes |
| String | Middle Name of Seller | No |
| String | Last Name of Seller | Yes |
| String | Phone Number of Seller | No |
| String | State of Seller | Yes |
| String | Zip/Pin code of Seller | Yes |
| String | Client Pan Number | Yes |
| String | Currency (default value is “INR”) | No |
| String | Name of Seller | Yes |
| Date | Order Date and Time | Yes |
| String | Time Zone in which order time and invoice time will be printed | Yes |
| String | Name of customer | Yes |
| String | Type of order. Can have one of these two values:”SALES” and “STOCK_TRANSFER” | Yes |
| String | Internal Order Id in Seller’s system | Yes |
| String | Channel Order Id | No |
| String | Channel Name | No |
| Object[] | Invoice Items | No |
| Long | Unique Identifier for the line items (should be the same as the line item id used for computing tax) | Yes |
| String | Channel SKU | Yes |
| String | Item Name | Yes |
| String | Order Item Code. This field is required to be sent only when the tax details are not computed from RMS | No |
| String | Style Id. This field is required to be sent only when the tax details are not computed from RMS | No |
| Double | MRP of the product. This field is required to be sent only when the tax details are not computed from RMS | No |
| Double | Discount of the product. This field is required to be sent only when the tax details are not computed from RMS | No |
| String | Category of the product. This field is required to be sent only when the tax details are not computed from RMS | No |
| Double | Selling Price of the product. This field is required to be sent only when the tax details are not computed from RMS | No |
| Double | Shipping Charge applied on the product. This field is required to be sent only when the tax details are not computed from RMS | No |
| Double | COD Charge of the product. This field is required to be sent only when the tax details are not computed from RMS | No |
| Integer | Quantity of the product. This field is required to be sent only when the tax details are not computed from RMS | No |
| String | HSN of the product. This field is required to be sent only when the tax details are not computed from RMS | No |
| String | Vendor SKU of the product. This field is required to be sent only when the tax details are not computed from RMS | No |
| Double | Tax Amount of the product. This field is required to be sent only when the tax details are not computed from RMS | No |
| Double | Tax Rate applied on the product. This field is required to be sent only when the tax details are not computed from RMS | No |
| List | List of sub tax items. This field is required to be sent only when the tax details are not computed from RMS | No |
| String | Type of sub tax item. This field is required to be sent only when the tax details are not computed from RMS | No |
| Double | Sub Tax Item Rate. This field is required to be sent only when the tax details are not computed from RMS | No |
| Double | Sub Tax Item Amount. This field is required to be sent only when the tax details are not computed from RMS | No |
Response
{
"orderCode":"order1234",
"shipmentCode":"101",
"invoiceId":"INCREFF_1003",
"documentUrl":"https://storage.googleapis.com/dev-oltp-nextscm-com/1001080/Invoice/invoice_INCREFF_1003.pdf",
"invoiceDate":"2021-06-11T19:43:20.673+05:30"
,
}
Response if E-Invoicing is enabled
{
"orderCode":"order1234",
"shipmentCode":"101",
"invoiceId":"INCREFF_1003",
"documentUrl":"https://storage.googleapis.com/dev-oltp-nextscm-com/1001080/Invoice/invoice_INCREFF_1003.pdf",
"invoiceDate":"2021-06-11T19:43:20.673+05:30"
,
"irn":"50abcdc88aasd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bWVudCBcIixcIkxvY1wiOlwiR3VyZ2FvblwiLFwiUGluXCI6MTIyMDE3LFwiU3RjZFwiOlwiMDZcIn0sXCJJdGVtTGlzdFwiOlt7XCJJdGVtTm9cIjowLFwiU2xOb1wiOlwiMVwiLFwiSXNTZXJ2Y1wiOlwiTlwiLFwiUHJkRGVzY1wiOlwiS0lFTFwiLFwiSHNuQ2RcIjpcIjY0MDQxOTkwXCIsXCJRdHlcIjoxLjAsXCJVbml0XCI6XCJQQ1NcIixcIlVuaXRQcmljZVwiOjM5MS4yOSxcIlRvdEFtdFwiOjM5MS4yOSxcIkFzc0FtdFwiOjM5MS4yOSxcIkdzdFJ0XCI6MTIuMDAwLFwiSWdzdEFtdFwiOjAuMDAsX",
"signedQRCode":"EzLzEyLzIwMjJcIixcIlRvdEludlZhbFwiOjQzOC4yNSxcIkl0ZW1DbnRcIjoxLFwiTWFpbkhzbkNvZGVcIjpcIjY0MDQxOTkwXCIsXCJJcm5cIjpcIjUwZTk2NTFjZDM2M2E0MjgyMzllZWVlY2M4OGE2OWQyZjNmNTMyMmE1YjE0NWUyMTE0ZTRjMjI4OGJmZjgwMTVcIixcIklybkR0XCI6XCIyMDIyLTEyLTEzIDE1OjI0OjAwXC",
}
Parameter Name | Data Type | Description | Mandatory |
| String | The order code against which Invoice is being generated | Yes |
| String | The shipment code against which Invoice is being generated | Yes |
| String | Invoice Id for the Invoice generated | Yes |
| String | Downloadable URL of the InvoicePDF | Yes |
| Date | Invoice Time | Yes |
| String | IRN generated by Government Portal. This will be sent in the E-Invoicing case. | No |
| String | Signed Invoice generated by Government Portal. This will be sent in the E-Invoicing case. | Yes |
| String | Signed QR Code generated by Government Portal. This will be sent in the E-Invoicing case. | Yes |
FAQs
For E-Invoice generation, will the same API be used?
Yes, the same API will be used. You will get the additional e-invoice applicable fields in the response such as IRN, QR code etc. Refer the below sample response for E-Invoice.
Is it mandatory to make the Compute Tax API call before the Create Invoice API call?
It is mandatory to make the Compute Tax API call before the Create Invoice API call if you are not passing the tax details in the request payload of the create invoice API call.
If you are passing the tax details in the request payload of the Create Invoice API call, then the Compute Tax call is not required to be made.