Skip to main content
PATCH
Available in🇮🇳 India🇸🇬 Singapore🇺🇸 United States
Use this endpoint to update the details of the invoice. The following table displays ths updates allowed as per invoice states:

Path Parameters

string
required
The unique identifier of the invoice.

Request Parameters

string
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
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. In the case of three decimal currencies, such as KWD, BHD and OMR, to refund a payment of 295.991, pass the value as 295990. And in the case of zero decimal currencies such as JPY, to refund a payment of 295, pass the value as 295.
Watch Out!As per payment guidelines, you should pass the last decimal number as 0 for three decimal currency payments. For example, if you want to refund a customer 99.991 KD for a transaction, you should pass the value for the amount parameter as 99990 and not 99991.
string
The currency associated with the item. Defaults to INR. Know about the list of supported international currencies. This should match invoice currency.
Handy TipsRazorpay has added support for zero decimal currencies, such as JPY, and three decimal currencies, such as KWD, BHD, and OMR, allowing businesses to accept international payments in these currencies. Know more about Currency Conversion (May 2024).
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
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.
Handy TipsRazorpay has added support for zero decimal currencies, such as JPY, and three decimal currencies, such as KWD, BHD, and OMR, allowing businesses to accept international payments in these currencies. Know more about Currency Conversion (May 2024).

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, .
string
A unique key used to ensure idempotency of the invoice creation request, preventing duplicate invoices.
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.
string
Unique identifier of the subscription this invoice was generated for. null for one-off invoices.

Errors

Code: 400The 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: 400The mentioned parameters are not required for updating an invoice. The API echoes the rejected field name in the response.Solution: Pass only the required parameters in the Update Invoice API.
Code: 400Only name is entered without item id or amount.Solution: Provide either the item id or the amount with the name.
Code: 400Possible reasons:
  • Only the amount field is entered without a name or item id.
  • The amount, name or item id are not entered.
Solution: Provide the name field of the item when passing the amount.
Code: 400The invoice already has one or more line_items. Razorpay derives the invoice amount from the line items, so a top-level amount cannot be updated independently.Solution: Update the corresponding line_items[].amount instead, or remove the line items before changing the invoice amount.