Create an Invoice With Customer Details
Create an Invoice with basic details such as name and billing address.
name, billing_address and shipping_address.
- tax rate
- cess
- HSN code
- SAC code
Request Parameters
invoice.draft state when value is set to 1.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.Gaurav Kumar.gaurav.kumar@example.com.+919876543210.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.item_id is not provided.30000. Mandatory if item_id is not provided.INR. Know about the list of supported international currencies. This should match invoice currency.1.true(default): Razorpay sends the notification to the customer.false: You send the notification to the customer.
true(default): Razorpay sends the notification to the customer.false: You send the notification to the customer.
true: The customer can make partial payments.false(default): The customer cannot make partial payments.
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.Response Parameters
invoice.invoice.customer_id using the Customers API. Alternatively, you can pass the customer object described in the below fields.cust_1Aa00000000004.Gaurav Kumar.gaurav.kumar@example.com.+919876543210.billing_address.true: It is the customer’s primary address.false: It is not the customer’s primary address.
shipping_address.true: It is the customer’s primary address.false: It is not the customer’s primary address.
INR. Know about the list of supported international currencies.invoice.1.draftissuedpartially_paidpaidcancelledexpireddeleted
pendingsent
pendingsent
true: The customer can make partial payments.false(default): The customer cannot make partial payments.
30000.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.₹.50000.Errors
The API `<key/secret>
` provided is invalid.
The API `<key/secret> ` provided is invalid.
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.customer is required.
customer is required.
400An invoice is issued without adding customer details.Solution: Ensure that the customer details are entered.the merchant doesn't have international activated.
the merchant doesn't have international activated.
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.Currency of all items should be the same as of the invoice.
Currency of all items should be the same as of the invoice.
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.expire_by should be at least 15 minutes after current time.
expire_by should be at least 15 minutes after current time.
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.line_items is required.
line_items is required.
400A mandatory field is empty.Solution: Ensure that you fill all the mandatory fields.Not a valid type.
Not a valid type.
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.The amount must be at least INR 1.00.
The amount must be at least INR 1.00.
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.The amount must be an integer.
The amount must be an integer.
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).The quantity must be at least 1.
The quantity must be at least 1.
400A line-item quantity was passed as 0 or a negative value.Solution: Pass line_items[].quantity as a positive integer (1 or higher).The email must be a valid email address.
The email must be a valid email address.
400The value passed for customer.email is not in a valid email format.Solution: Pass customer.email as a valid email address.Contact number contains invalid characters, only digits and + symbol are allowed.
Contact number contains invalid characters, only digits and + symbol are allowed.
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.The partial payment field must be true or false.
The partial payment field must be true or false.
400A non-boolean value was passed for partial_payment.Solution: Pass partial_payment as a boolean (true or false).{any extra field} is/are not required and should not be sent.
{any extra field} is/are not required and should not be sent.
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.Invoices disabled because fee bearer is customer.
Invoices disabled because fee bearer is customer.
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.Item cannot be used as it is inactive.
Item cannot be used as it is inactive.
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.The merchant doesn't have international activated.
The merchant doesn't have international activated.
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.Currency is not supported.
Currency is not supported.
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.Invoice amount exceeds maximum payment amount allowed.
Invoice amount exceeds maximum payment amount allowed.
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.expire_by should be at least 15 minutes after current time.
expire_by should be at least 15 minutes after current time.
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.Request failed. Please try after sometime.
Request failed. Please try after sometime.
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.