API ReferenceIntegrationsKnowledge Base

Configure Payment Capture Settings using Orders API

Once your customer completes a payment, it is automatically moved to captured state. However, the payment can attain authorized state in the following scenarios:

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.

Note:
The options sent in the below API take precedence over the account level auto-capture settings configured using the Dashboard.

API#

Use the below endpoint to configure auto-capture settings for individual payments.

/orders

Request Parameters#

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. List of supported currencies.

payment optional

array Payment capture settings for the payment. The options sent here override the account level auto-capture settings configured using the Dashboard.

capture mandatory

string Option to automatically capture payment. Possible values:

  • automatic - Payments are auto-captured according to the configurations specified in the capture_options array.
  • manual - You have to manually capture payments using our Capture API or from the Dashboard.
capture_options optional

array Use this array to determine the expiry period for automatic and manual capture of payments and the refund speed in the case of non-capture.

automatic_expire_period mandatory if capture = automatic
integer Time in minutes till when payments in the authorized state should be auto-captured.
Minimum value 12 minutes.
manual_expire_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_expire_period value.
  • Default value 7200 minutes.
  • Maximum value 7200 minutes.
  • Payments in the authorized state after the manual_expire_period are auto-refunded.
refund_speed mandatory
string Refund speed for payments that were not captured (automatically or manually). Possible values:
  • optimum - We try to process the refund instantly. We charge a small fee for this. If it is not possible to process an instant refund, we will process a normal refund in 5-7 working days. Learn more about instant refunds.
  • normal - The refund is processed in 5-7 working days.

    If no value is passed, the refund is processed using the default speed set on the Dashboard.
receipt optional

string Maximum length 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”.

Response Parameters#

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. List of supported currencies.
receipt
string Maximum length 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 the created state.
    It stays in this state till a payment is attempted on it.
  • attempted - An order moves from created to attempted state when a payment is first attempted on it.
    It remains in the attempted state till one payment associated with that order is captured.
  • paid - After the successful capture of the payment, the order moves to the paid state.
    No further payment requests are permitted once the order moves to the paid state.
    The order stays in the paid state 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.

Note:

  • If automatic_expiry_period is 60 minutes and manual_expiry_period is 120 minutes, payments in the authorized state after 120 minutes are auto-refunded.
  • If automatic_expiry_period is 0 minutes and manual_expiry_period is 120 minutes, payments in the authorized state after 120 minutes are auto-refunded.