Skip to main content
Use this endpoint to update the details of the invoice. The following table displays ths updates allowed as per invoice states:

Status | Parameter Update Allowed

Draft | All parameters can be updated including the line items. You can also add new line items.

Issued | You can update the following parameters: - partial_payment
  • receipt
  • comment
  • terms
  • notes
  • expire_by

Cancelled | Only notes can be updated.

Expired | Only notes can be updated.

Partially Paid | Only notes can be updated.

Paid | Only notes can be updated.

Request

/invoices/:id
Curl

Response

Success

Parameters

id mandatory : string The unique identifier of the invoice.

Parameters

type : string Indicates the type of entity. Here, it is invoice. description : string A brief description of the invoice. draft : string Invoice is created in draft state when value is set to 1. customer_id : 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. customer : object Customer details. name mandatory : 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. email optional : string The customer’s email address. A maximum length of 64 characters. For example, gaurav.kumar@example.com. contact optional : string The customer’s phone number. A maximum length of 15 characters including country code. For example, +919876543210. billing_address : object The customer’s billing address. line1 mandatory : string The first line of the customer’s address. line2 optional : string The second line of the customer’s address. city mandatory : string The city zipcode mandatory : string The zipcode state mandatory : string The state country mandatory : string The country shipping_address : object The customer’s shipping address. line1 mandatory : string The first line of the customer’s address. line2 optional : string The second line of the customer’s address. city mandatory : string The city zipcode mandatory : string The zipcode state mandatory : string The state country mandatory : string The country line_items : object Details of the line item that is billed in the invoice. Maximum of 50 line items. item_id conditionally mandatory : string 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. name conditionally mandatory : string The item name. Mandatory if item_id is not provided. description optional : string A brief description of the item. amount conditionally mandatory : 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 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.currency optional : string The currency associated with the item. Defaults to INR. Know about the list of supported international currencies. This should match invoice currency.
Handy Tips
Razorpay 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).quantity optional : integer The number of units of the item billed in the invoice. Defaults to 1.expire_by : integer Timestamp, in Unix format, at which the invoice will expire.sms_notify : 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.
email_notify : 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.
partial_payment : 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.
currency : 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 Tips
Razorpay 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).

Parameters

id : string The unique identifier of the invoice. entity : string Indicates the type of entity. Here, it is invoice. type : string Here, it should be invoice. invoice_number : string Unique number you added for internal reference. The minimum character length is 1 and maximum is 40. customer_id : 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. customer_details : object Details of the customer. id : string Unique identifier of the customer. For example, cust_1Aa00000000004. name : 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. email : string The customer’s email address. A maximum length of 64 characters. For example, gaurav.kumar@example.com. contact : string The customer’s phone number. A maximum length of 15 characters including country code. For example, +919876543210. billing_address : object Details of the customer’s billing address. id : string The unique identifier generated for the customer’s billing address. type : string The customer address type. Here it is billing_address. primary : 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.
line1 : string The first line of the customer’s address. line2 : string The second line of the customer’s address. city : string The city. zipcode : string The zipcode. state : string The state. country : string The country. shipping_address : object Details of the customer’s shipping address. id : string The unique identifier generated for the customer’s shipping address. type : string The customer address type. Here it is shipping_address. primary : 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.
line1 : string The first line of the customer’s address. line2 : string The second line of the customer’s address. city : string The city. zipcode : string The zipcode. state : string The state. country : string The country. order_id : string The unique identifier of the order associated with the invoice. line_items : object Details of the line item that is billed in the invoice. Maximum of 50 line items. id : string Unique identifier that is generated if a new item has been created while creating the invoice. item_id : string Unique identifier of the item generated using Items API that has been billed in the invoice. name : string The item’s name. description : string A brief description of the item. amount : integer The price of the item. currency : string The currency associated with the item. Default is INR. Know about the list of supported international currencies. type : string Here, it is invoice. quantity : integer The quantity of the item billed in the invoice. Defaults to 1. . type : string Here, it is invoice. quantity : integer The quantity of the item billed in the invoice. Defaults to 1. payment_id : string Unique identifier of a payment made against this invoice. status : string The status of the invoice. Know more about Invoice States. Possible values:
  • draft
  • issued
  • partially_paid
  • paid
  • cancelled
  • expired
  • deleted
expire_by : integer Timestamp, in Unix format, at which the invoice will expire. issued_at : integer Timestamp, in Unix format, at which the invoice was issued to the customer. paid_at : integer Timestamp, in Unix format, at which the payment was made. cancelled_at : integer Timestamp, in Unix format, at which the invoice was cancelled. expired_at : integer Timestamp, in Unix format, at which the invoice expired. sms_status : string The delivery status of the SMS notification for the invoice sent to the customer. Possible values:
  • pending
  • sent
email_status : string The delivery status of the email notification for the invoice sent to the customer. Possible values:
  • pending
  • sent
partial_payment : 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.
amount : 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. amount_paid : integer Amount paid by the customer against the invoice. amount_due : integer The remaining amount to be paid by the customer for the issued invoice. currency : 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. . description : string A brief description of the invoice. The maximum character length is 2048. notes : object Any custom notes added to the invoice. Maximum of 2048 characters. short_url : string The short URL that is generated. Share this link with customers to accept payments. date : integer Timestamp, in Unix format, that indicates the issue date of the invoice. terms : string Any terms to be included in the invoice. Maximum of 2048 characters. comment : string Any comments to be added in the invoice. Maximum of 2048 characters.

Errors

The api key provided is invalid
  • code: 400
  • description: The 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, line_items, sms_notify, email_notify, draft, date is/are not required and should not be sent
  • code: 400
  • description: The mentioned parameters are not required for updating an invoice.
  • solution: Pass only the required parameters in the Update Invoice API.
The amount field is required when item id is not present.
  • code: 400
  • description: Only name is entered without item id or amount.
  • solution: Provide either the item id or the amount with the name.
The name field is required when item id is not present.
  • code: 400
  • description: Possible 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.