Skip to end of banner
Go to start of banner

Create Invoice

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

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

orderCode

String

This is the order code which the tax details were calculated and the invoice PDF needs to be generated.

yes

shipmentCode

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

billingAddress

Object

Billing Address of the customer

Yes

billingAddress.city

String

City of customer

Yes

billingAddress.country

String

Country of customer

Yes

billingAddress.email

String

Email of customer

No

billingAddress.street1

String

1st line of customer address

Yes

billingAddress.street2

String

2nd line of customer address

No

billingAddress.street3

String

3rd line of customer address

No

billingAddress.firstName

String

First Name of customer

Yes

billingAddress.middleName

String

Middle Name of customer

No

billingAddress.lastName

String

Last Name of customer

Yes

billingAddress.phone

String

Phone number of customer

No

billingAddress.state

String

State of customer

Yes

billingAddress.zip

String

Zip/Pin code of customer

Yes

shippingAddress

Object

Total quantity of a sku for a line item

Yes

shippingAddress.city

String

City of customer

Yes

shippingAddress.country

String

Country of customer

Yes

shippingAddress.email

String

Email of customer

No

shippingAddress.street1

String

1st line of customer address

Yes

shippingAddress.street2

String

2nd line of customer address

No

shippingAddress.street3

String

3rd line of customer address

No

shippingAddress.firstName

String

First Name of customer

Yes

shippingAddress.middleName

String

Middle Name of customer

No

shippingAddress.lastName

String

Last Name of customer

Yes

shippingAddress.phone

String

Phone Number of customer

No

shippingAddress.state

String

State of customer

Yes

shippingAddress.zip

String 

Zip/Pin code of customer

Yes

fromAddress

Object

Seller Address

Yes

fromAddress.city

String

City of Seller

Yes

fromAddress.country

String

Country of Seller

Yes

fromAddress.email

String 

Email of Seller

No

fromAddress.street1

String

1st line of Seller address

Yes

fromAddress.street2

String

2nd line of Seller address

No

fromAddress.street3

String

3rd line of Seller address

No

fromAddress.firstName

String

First Name of Seller

Yes

fromAddress.middleName

String

Middle Name of Seller

No

fromAddress.lastName

String

Last Name of Seller

Yes

fromAddress.phone

String

Phone Number of Seller

No

fromAddress.state

String

State of Seller

Yes

fromAddress.zip

String

Zip/Pin code of Seller

Yes

clientPanNo

String

Client Pan Number

Yes

currency

String

Currency (default value is “INR”)

No

fromPartyName

String

Name of Seller

Yes

orderTime

Date

Order Date and Time

Yes

timeZone

String

Time Zone in which order time and invoice time will be printed

Yes

toPartyName

String

Name of customer

Yes

orderType

String

Type of order. Can have one of these two values:”SALES” and “STOCK_TRANSFER”

Yes

internalOrderId

String

Internal Order Id in Seller’s system

Yes

channelOrderId

String

Channel Order Id

No

channelName

String

Channel Name

No

invoiceItems

Object[]

Invoice Items

No

invoiceItems.lineItemId

Long

Unique Identifier for the line items (should be the same as the line item id used for computing tax) 

Yes

invoiceItems.channelSku

String

Channel SKU

Yes

invoiceItems.itemName

String

Item Name

Yes

invoiceItems.orderItemCode

String

Order Item Code. This field is required to be sent only when the tax details are not computed from RMS

No

invoiceItems.styleId

String

Style Id. This field is required to be sent only when the tax details are not computed from RMS

No

invoiceItems.mrp

Double

MRP of the product. This field is required to be sent only when the tax details are not computed from RMS

No

invoiceItems.discount

Double

Discount of the product. This field is required to be sent only when the tax details are not computed from RMS

No

invoiceItems.category

String

Category of the product. This field is required to be sent only when the tax details are not computed from RMS

No

invoiceItems.actualSellingPricePerUnit

Double

Selling Price of the product. This field is required to be sent only when the tax details are not computed from RMS

No

invoiceItems.shippingChargePerUnit

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

invoiceItems.codChargePerUnit

Double

COD Charge of the product. This field is required to be sent only when the tax details are not computed from RMS

No

invoiceItems.quantity

Integer

Quantity of the product. This field is required to be sent only when the tax details are not computed from RMS

No

invoiceItems.hsn

String

HSN of the product. This field is required to be sent only when the tax details are not computed from RMS

No

invoiceItems.vendorSku

String

Vendor SKU of the product. This field is required to be sent only when the tax details are not computed from RMS

No

invoiceItems.taxAmountPerUnit

Double

Tax Amount of the product. This field is required to be sent only when the tax details are not computed from RMS

No

invoiceItems.taxRate

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

invoiceItems.subTaxItems

List

List of sub tax items. This field is required to be sent only when the tax details are not computed from RMS

No

invoiceItems.subTaxItems.type

String

Type of sub tax item. This field is required to be sent only when the tax details are not computed from RMS

No

invoiceItems.subTaxItems.rate

Double

Sub Tax Item Rate. This field is required to be sent only when the tax details are not computed from RMS

No

invoiceItems.subTaxItems.taxPerUnit

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":"50abcdc88aasdf5e2asd015",

   "signedInvoice":"sXCJQaW5cIjoxMjIwMDEsXCJTdGNkXCI6XCIwNlwiLFwiRW1cIjpcImNsaWVudEBkdW1teS5jb21cIn0sXCJCdXllckR0bHNcIjp7XCJHc3RpblwiOlwiMDZBQUJDUjE3MThFMVpUXCIsXCJMZ2xObVwiOlwiUmVsaWFuY2UgUmV0YWlsIEx0ZC5cIixcIlBvc1wiOlwiMDZcIixcIkFkZHIxXCI6XCJSZWxpYW5jZSBSZXRhaWwgTHRkLCBTaG9wIE5vIDI3IDI4IFVHIDEwMiBCYXNlbWVudFwiLFwiQWRkcjJcIjpcIlVwcGVyIEdGIGFuZCAxc3QgZmxv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6MTIuMDAwLFwiSWdzdEFtdFwiOjAuMDAsX",

"signedQRCode":"EzLzEyLzIwMjJcIixcIlRvdEludlZhbFwiOjQzOC4yNSxcIkl0ZW1DbnRcIjoxLFwiTWFpbkhzbkNvZGVcIjpcIjY0MDQxOTkwXCIsXCJJcm5cIjpcIjUwZTk2NTFjZDM2M2E0MjgyMzllZWVlY2M4OGE2OWQyZjNmNTMyMmE1YjE0NWUyMTE0ZTRjMjI4OGJmZjgwMTVcIixcIklybkR0XCI6XCIyMDIyLTEyLTEzIDE1OjI0OjAwXC",

}

Parameter Name

Data Type

Description

Mandatory

orderCode

String

The order code against which Invoice is being generated

Yes

shipmentCode

String

The shipment code against which Invoice is being generated

Yes

invoiceId

String

Invoice Id for the Invoice generated

Yes

documentUrl

String

Downloadable URL of the InvoicePDF

Yes

invoiceDate

Date

Invoice Time

Yes

irn

String

IRN generated by Government Portal. This will be sent in the E-Invoicing case.

No

signedInvoice

String

Signed Invoice generated by Government Portal. This will be sent in the E-Invoicing case.

Yes

signedQRCode

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.

  • No labels