Configure Payment Capture Settings using Orders API
Configure auto-capture settings for individual payments using APIs.
Once your customer completes a payment, it is automatically moved to captured state. However, the payment can attain authorized state in the following scenarios:
- Late authorization
Due to external factors such as network issues or technical errors, Razorpay may not receive payment status from the bank immediately. In this case, Razorpay polls the APIs intermittently for 5 days to check the status. If we receive the payment status as successful, the payment is moved to theauthorizedstate. . - Specific business use case
Some businesses such as those in the Ecommerce industry may retain the payment in theauthorizedstate and later move them to thecapturedstate.
You must ensure that all payments in the authorized state are moved to the captured state within 5 days of creation. This is mandatory because payments that are not captured within this time period will be refunded automatically to customers.
You can configure Payment Capture setting for individual payments using the Orders API.
Watch Out!
The options sent in the below API take precedence over the
configured using the Dashboard.Use the below endpoint to configure auto-capture settings for individual payments.
amount
mandatory
integer The amount, in currency subunit, for order. For example, for an amount of ₹295, enter 29500.
currency
mandatory
string 3-letter ISO currency code for the payment.
payment
optional
array Payment capture settings for the payment. The options sent here override the
capture
mandatory
string Option to automatically capture payment. Possible values:
automatic: Payments are auto-captured according to the configurations specified in thecapture_optionsarray.manual: You have to manually capture payments using our or from the .
capture_options
optional
array Use this array to determine the expiry period for automatic and
automatic_expiry_period
mandatory if capture = automatic
integer Time in minutes till when payments in the authorized state should be auto-captured.
Minimum value 12 minutes. This parameter is mandatory only if the value of capture parameter is automatic.
manual_expiry_period
optional
integer Time in minutes till when you can manually capture payments in the authorized state.
- Must be equal to or greater than the
automatic_expiry_periodvalue. - Default value
7200minutes. - Maximum value
7200minutes. - Payments in the
authorizedstate after themanual_expiry_periodare auto-refunded.
refund_speed
mandatory
string Refund speed for payments that were not captured (automatically or manually). Possible values:
normal: The refund is processed in 5-7 working days.
If no value is passed, the refund is processed using the .
receipt
optional
string Maximum length is 40 characters. Receipt number, for internal reference, entered by you for the order.
notes
optional
object Key-value pair to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. For example, "note_key": "Beam me up Scotty”.
id
string The unique identifier of the order. For example, order_EKwxwAgItmmXdp.
amount
integer The amount, in currency subunit, for the order. For example, for an amount of ₹295, enter 29500.
amount_paid
integer The amount, in currency subunit, paid against the order.
amount_due
integer The amount, in currency subunit, pending against the order.
currency
string 3-letter ISO currency code for the payment.
receipt
string Maximum length is 40 characters. Receipt number, for internal reference, entered by you for the order.
status
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.
attempts
integer The number of payment attempts, successful and failed, that have been made against this order. For example, 1.
notes
object Key-value pairs to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. For example, "note_key": "Beam me up Scotty”.
created_at
integer Timestamp, in Unix, when the order was created. For example, 1593607540.
Handy Tips
- If
automatic_expiry_periodis60minutes andmanual_expiry_periodis120minutes, payments in theauthorizedstate after120minutes are auto-refunded. - If
automatic_expiry_periodis0minutes andmanual_expiry_periodis120minutes, payments in theauthorizedstate after120minutes are auto-refunded.
Was this page helpful?