Skip to main content
POST
Use this endpoint to create an invoice using details such as name, billing_address and shipping_address.
Handy TipsYou cannot create GST compliant invoices using APIs. This means you cannot add the following to the invoice when creating an invoice via APIs:
  • tax rate
  • cess
  • HSN code
  • SAC code

Request Parameters

string
required
Indicates the type of entity. Here, it is invoice.
string
A brief description of the invoice.
string
Invoice is created in draft state when value is set to 1.
string
required
You can pass the customer_id in this field, if you are using the Customers API. If not, you can pass the customer object described in the below fields.
object
Customer details.
string
required
Customer’s name. Alphanumeric, with period (.), apostrophe (’) and parentheses allowed. The name must be between 3-50 characters in length. For example, Gaurav Kumar.
string
The customer’s email address. A maximum length of 64 characters. For example, gaurav.kumar@example.com.
string
The customer’s phone number. A maximum length of 15 characters including country code. For example, +919876543210.
object
The customer’s billing address.
string
required
The first line of the customer’s address.
string
The second line of the customer’s address.
string
required
The city
string
required
The zipcode
string
required
The state
string
required
The country
object
The customer’s shipping address.
string
required
The first line of the customer’s address.
string
The second line of the customer’s address.
string
required
The city
string
required
The zipcode
string
required
The state
string
required
The country
object
Details of the line item that is billed in the invoice. Maximum of 50 line items.
string
required
If you are using the Items API, you may use an existing item. You can choose to override details such as name, description by passing these along with item_id. While the invoice will show the updated details, the existing item will not be updated. This parameter is mandatory if you are not going to use any other parameter in the array.
string
required
The item name. Mandatory if item_id is not provided.
string
A brief description of the item.
integer
required
Amount to be paid using the invoice. Must be in the smallest unit of the currency. For example, if the amount to be received from the customer is ₹300, pass the value as 30000. Mandatory if item_id is not provided.
string
The currency associated with the item. Defaults to INR. Know about the list of supported international currencies. This should match invoice currency.
integer
The number of units of the item billed in the invoice. Defaults to 1.
integer
Timestamp, in Unix format, at which the invoice will expire.
boolean
Defines who handles the SMS notification. Possible values:
  • true (default): Razorpay sends the notification to the customer.
  • false: You send the notification to the customer.
boolean
Defines who handles the email notification. Possible values:
  • true (default): Razorpay sends the notification to the customer.
  • false: You send the notification to the customer.
boolean
Indicates whether the customer can make a partial payment on the invoice. Possible values:
  • true: The customer can make partial payments.
  • false (default): The customer cannot make partial payments.
string
required
The currency associated with the invoice. You must mandatorily pass this parameter if accepting international payments. If you have passed currency as a sub-parameter in the line_item object, you must ensure that the same currency is passed in both places. Know about the list of supported international currencies.
string
Any custom notes added to the invoice. Maximum of 2048 characters.

Response Parameters

string
The unique identifier of the invoice.
string
Indicates the type of entity. Here, it is invoice.
string
Here, it should be invoice.
string
Unique number you added for internal reference. The minimum character length is 1 and maximum is 40.
string
The unique identifier of the customer. You can create customer_id using the Customers API. Alternatively, you can pass the customer object described in the below fields.
object
Details of the customer.
string
Unique identifier of the customer. For example, cust_1Aa00000000004.
string
Customer’s name. Alphanumeric, with period (.), apostrophe (’) and parentheses allowed. The name must be between 3-50 characters in length. For example, Gaurav Kumar.
string
The customer’s email address. A maximum length of 64 characters. For example, gaurav.kumar@example.com.
string
The customer’s phone number. A maximum length of 15 characters including country code. For example, +919876543210.
object
Details of the customer’s billing address.
string
The unique identifier generated for the customer’s billing address.
string
The customer address type. Here it is billing_address.
boolean
Defines if this is the primary address.
  • true: It is the customer’s primary address.
  • false: It is not the customer’s primary address.
string
The first line of the customer’s address.
string
The second line of the customer’s address.
string
The city.
string
The zipcode.
string
The state.
string
The country.
object
Details of the customer’s shipping address.
string
The unique identifier generated for the customer’s shipping address.
string
The customer address type. Here it is shipping_address.
boolean
Defines if this is the primary address.
  • true: It is the customer’s primary address.
  • false: It is not the customer’s primary address.
string
The first line of the customer’s address.
string
The second line of the customer’s address.
string
The city.
string
The zipcode.
string
The state.
string
The country.
string
The unique identifier of the order associated with the invoice.
object
Details of the line item that is billed in the invoice. Maximum of 50 line items.
string
Unique identifier that is generated if a new item has been created while creating the invoice.
string
Unique identifier of the item generated using Items API that has been billed in the invoice.
string
The item’s name.
string
A brief description of the item.
integer
The price of the item.
string
The currency associated with the item. Default is INR. Know about the list of supported international currencies.
string
Here, it is invoice.
integer
The quantity of the item billed in the invoice. Defaults to 1.
string
Unique identifier of a payment made against this invoice.
string
The status of the invoice. Know more about Invoice States. Possible values:
  • draft
  • issued
  • partially_paid
  • paid
  • cancelled
  • expired
  • deleted
integer
Timestamp, in Unix format, at which the invoice will expire.
integer
Timestamp, in Unix format, at which the invoice was issued to the customer.
integer
Timestamp, in Unix format, at which the payment was made.
integer
Timestamp, in Unix format, at which the invoice was cancelled.
integer
Timestamp, in Unix format, at which the invoice expired.
string
The delivery status of the SMS notification for the invoice sent to the customer. Possible values:
  • pending
  • sent
string
The delivery status of the email notification for the invoice sent to the customer. Possible values:
  • pending
  • sent
boolean
Indicates whether the customer can make a partial payment on the invoice. Possible values:
  • true: The customer can make partial payments.
  • false (default): The customer cannot make partial payments.
integer
Amount to be paid using the invoice. Must be in the smallest unit of the currency. For example, if the amount to be received from the customer is , pass the value as 30000.
integer
Amount paid by the customer against the invoice.
integer
The remaining amount to be paid by the customer for the issued invoice.
string
The currency associated with the invoice. You must mandatorily pass this parameter if accepting international payments. If you have passed currency as a sub-parameter in the line_item object, you must ensure that the same currency is passed in both places. Know about the list of supported international currencies.
string
A brief description of the invoice. The maximum character length is 2048.
object
Any custom notes added to the invoice. Maximum of 2048 characters.
string
The short URL that is generated. Share this link with customers to accept payments.
integer
Timestamp, in Unix format, that indicates the issue date of the invoice.
string
Any terms to be included in the invoice. Maximum of 2048 characters.
string
Any comments to be added in the invoice. Maximum of 2048 characters.
string
A unique reference number for the invoice, used for internal tracking and reconciliation.
string
A unique receipt number that you can provide for the invoice, for your internal reference.
string
For example, .
integer
Unix timestamp marking the end of the billing period for the invoice.
integer
The gross amount for this invoice, in the smallest currency unit (paise for INR). For example, 50000.
integer
Unix timestamp marking the start of the billing period for the invoice.

Errors

Code: 4xxThe API key or secret are not entered or an invalid API key is used.Solution: Use and enter the correct API details while executing the API.
Code: 400An invoice is issued without adding customer details.Solution: Ensure that the customer details are entered.
Code: 400The line_items object has an international currency set. For example, USD, is not enabled for your account.Solution: Ensure that your account has international payments enabled.
Code: 400There is a difference in currency entered between line_items and invoice currency.Solution: Ensure that the line_items currency matches that of the invoice.
Code: 400The expiry date is before or within 15 minutes of the current timeSolution: Ensure that the Expiry date is greater than the (current time + 15 minutes). For example, if the current time is 1 pm, the expiry date must be at least 1.15 pm.
Code: 400A mandatory field is empty.Solution: Ensure that you fill all the mandatory fields.
Code: 400The value passed for type is not one of the supported types. The API echoes the rejected value, for example Not a valid type: invoiceee.Solution: Use a supported type value, for example invoice, ecod or link.
Code: 400A line-item amount is below the per-currency minimum (100 paise / ₹1.00 for INR). Also returned for zero or negative line-item amounts.Solution: Pass each line_items[].amount greater than or equal to the per-currency minimum.
Code: 400A non-integer value (for example a decimal like 100.5 or a string like "abc") was passed for a line_items[].amount.Solution: Pass amount as an integer in currency subunits (paise for INR).
Code: 400A line-item quantity was passed as 0 or a negative value.Solution: Pass line_items[].quantity as a positive integer (1 or higher).
Code: 400The value passed for customer.email is not in a valid email format.Solution: Pass customer.email as a valid email address.
Code: 400The customer.contact value contains characters other than digits and the + symbol.Solution: Pass customer.contact using only digits and an optional leading + for the country code.
Code: 400A non-boolean value was passed for partial_payment.Solution: Pass partial_payment as a boolean (true or false).
Code: 400The request body contains fields that are not part of the Invoices API schema.Solution: Only include documented fields. Remove any unknown keys from the request body.
Code: 400Your account has the customer fee bearer model enabled, which is not compatible with invoice creation.Solution: Contact Razorpay support to switch the fee-bearer configuration before creating invoices.
Code: 400A line_items[].item_id passed in the request refers to an item that has been marked inactive.Solution: Activate the item via the Update Item API, or use a different active item.
Code: 400The currency passed is different from your account’s default currency, but international payments are not enabled on your account.Solution: Enable international payments from your Razorpay Dashboard, or use your account’s default currency.
Code: 400The currency value is not a recognised ISO-4217 currency code or is outside the list supported by Razorpay.Solution: Use a supported ISO-4217 currency code.
Code: 400The total invoice amount (sum of line_items[].amount * quantity) exceeds the per-payment maximum configured for your account.Solution: Split the billing into multiple invoices, or contact Razorpay support to raise your per-payment limit.
Code: 400The expire_by value is in the past or less than 15 minutes from the current server time.Solution: Pass expire_by as a Unix-epoch integer at least 15 minutes in the future.
Code: 429You have exceeded the daily rate limit for invoice creation. This per-day rate limit applies to test-mode accounts and unregistered live-mode accounts. In test mode the limit is 300 invoices/day; in live mode for unregistered businesses it is 10,000 invoices/day. Registered live-mode accounts are not subject to this limit.Solution: Wait until the next day for the limit to reset. If you need a higher limit, register your business on the Razorpay Dashboard or contact Razorpay support.