Order is an important step in the payment process.
- An order should be created for every payment.
- You can create an order using the . It is a server-side API call. Know how to Orders API.
- The order_id received in the response should be passed to the checkout. This ties the Order with the payment and secures the request from being tampered.
Given below are the order states and the corresponding payment states:
Payment Stages | Order State | Payment State | Description |
---|---|---|---|
Stage I | created | created | The customer submits the payment information, which is sent to Razorpay . The payment is not processed at this stage. |
Stage II | attempted | authorized/failed | An order moves from created to attempted state when payment is first attempted. It remains in this state until a payment associated with the order is captured. |
Stage III | paid | captured | After the payment moves to the captured state, the order moves to the paid state. • No more payment requests are allowed after an order moves to the paid state. • The order continues to be in this state even if the payment for this order is refunded . |
Handy Tips
You can capture payments automatically with the one-time
on the Razorpay Dashboard.In the sample app, the Payment.aspx.cs file contains the code for order creation using Orders API.
Here is the list of parameters for creating an order:
amount
mandatory
integer
The transaction amount, expressed in the currency subunit. For example, for an actual amount of ₹299.35, the value of this field should be 29935
.
currency
mandatory
string
The currency in which the transaction should be made. See the
receipt
optional
string
Pass receipt id for this order. Maximum length is 40 characters.
notes
optional
json object
Key-value pair 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”.
partial_payment
optional
boolean
Indicates whether the customer can make a partial payment. Possible values:
- true: Yes, the customer can make partial payments.
- false (default): No, the customer cannot make partial payments.
first_payment_min_amount
optional
integer
Minimum amount that the customer must pay as the first partial payment. For example, if an amount of ₹7,000.00 is to be received from the customer in two instalments of #1 - 5,000
, #2 - 2,000
, then you can set this value as 500000
. This parameter should be passed only if partial_payment
is true.
Know more about
.The error response parameters are available in the
.