Orders
Update an Order
Update an Order using Razorpay Orders API.
PATCH
Available in🇮🇳 India🇺🇸 United States
Use this endpoint to update an Order.
- You can modify an existing order to update the
Notesfield only. - Notes can be used to record additional information about the order.
- A key-value store, the
notesfield can have a maximum of 15 key-value pairs, each of 256 characters (maximum).
Path Parameters
string
required
Unique identifier of the order in which the
Notes field must be updated.Request Parameters
json object
required
Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. For example,
"note_key": "Beam me up Scotty”.Response Parameters
string
The unique identifier of the order.
integer
The amount for which the order was created, in currency subunits. For example, for an amount of , enter
29500.string
Name of the entity. Here, it is
order.integer
The amount paid against the order.
integer
The amount pending against the order.
string
required
ISO code for the currency in which you want to accept the payment. The default length is 3 characters.
string
Receipt number that corresponds to this order. Can have a maximum length of 40 characters and has to be unique.
string
The status of the order. Possible values:
created: When you create an order it is in thecreatedstate. It stays in this state till a payment is attempted on it.attempted: An order moves fromcreatedtoattemptedstate when a payment is first attempted on it. It remains in theattemptedstate till one payment associated with that order is captured.paid: After the successful capture of the payment, the order moves to thepaidstate. No further payment requests are permitted once the order moves to thepaidstate. The order stays in thepaidstate even if the payment associated with the order is refunded.
integer
The number of payment attempts, successful and failed, that have been made against this order.
json object
Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. For example,
"note_key": "Beam me up Scotty”.integer
Indicates the Unix timestamp when this order was created.
object
Checkout configuration applied to this order, when the order was created with checkout-time options (theme, prefill, partial-payment settings).
string
A brief description of the order, used for display purposes.
string
Unique identifier of the offer associated with this order.
Errors
The API `<key/secret>
` provided is invalid.
The API `<key/secret> ` provided is invalid.
Code:
400The API credentials passed in the API call differ from the ones generated on the Dashboard. Possible reasons:- Different keys for test mode and live modes.
- Expired API key.
id is not a valid id.
id is not a valid id.
Code:
400The order_id passed is invalid.Solution: Use a valid order_id.The id provided does not exist
The id provided does not exist
Code:
400The order_id does not exist or does not belong to the requestor.Solution: Ensure that you use a valid order_id that belongs to the requestor.amount is/are not required and should not be sent.
amount is/are not required and should not be sent.
Code:
400PATCH /v1/orders/:id only allows updating the notes field. Sending amount, currency, receipt or any other immutable field is rejected.Solution: Include only the notes field in the PATCH request body. To change other order properties, create a new order.Number of fields in notes should be less than or equal to 15.
Number of fields in notes should be less than or equal to 15.
Code:
400The notes object contains more than 15 key-value pairs.Solution: Limit notes to at most 15 key-value pairs.Notes key cannot be greater than 255 characters.
Notes key cannot be greater than 255 characters.
Code:
400One of the keys inside the notes object exceeds the 255-character limit.Solution: Keep each notes key under 256 characters.Notes value cannot be greater than 512 characters.
Notes value cannot be greater than 512 characters.
Code:
400One of the values inside the notes object exceeds the 512-character limit per value.Solution: Keep each notes value under 512 characters.Notes values themselves should not be an array.
Notes values themselves should not be an array.
Code:
400A value inside notes was passed as a JSON array. Only scalar values (string, number, boolean) are accepted as values.Solution: Convert array values into strings (for example, a comma-separated list) before sending.