Skip to main content
POST

Overview

Create Order is the first step in the payment flow. You send the buyer, product and invoice details from your backend, and choose how the payment is collected with collection_mode:
  • Hosted Checkout (hosted_payment) returns a session_id. You hand it to the EximPe JS SDK, which opens EximPe’s payment page.
  • S2S UPI Intent (s2s) returns an intent_uri that you use to open the customer’s UPI app.
Both return an order_id. A successful create returns 201 Created.

Headers

Create orders from your backend only. The request carries your Client Secret, so never send it from a browser or a mobile app.

Hosted Checkout and S2S UPI Intent

collection_mode has no default. Leave it out, or send another value, and the request is refused with {"collection_mode": "Invalid collection mode"}. S2S UPI Intent must be enabled on your account. See the S2S UPI Intent integration guide for the end-to-end flow.

Request Parameters

Fields not listed as required are optional. “Conditional” means the field is required only in the stated case.

Top-level

When you omit purpose_code, it is filled in only if your account has exactly one allowed code; otherwise it is left unset for later classification. Neither business_model nor purpose_code is returned by Create Order, and neither can be changed after the order is created. Read them back with Get Order Details.

Buyer

Address (buyer.address)

Product

Invoice

Examples

Response

A successful create returns 201 Created.

Hosted Checkout

  • order_id: The order’s ID
  • session_id: A 64-character hex string. Pass it to the EximPe JS SDK to open the payment page
The session_id is valid for 15 minutes. After that, create a new order to get a fresh one. An expired or already-completed session returns Invalid or expired session.

S2S UPI Intent

  • order_id: The order’s ID
  • intent_uri: The UPI payment request to open the customer’s UPI app with. See Invoking the intent
  • expires_at: When the intent stops accepting payment, in UTC — 5 minutes after creation
  • test_simulator_url: Sandbox only. Open it in a browser to complete the payment without a real UPI app; the result follows the test VPA you use in the simulator. Not returned in production
Sandbox responses may carry other testing fields. Ignore any field not listed here.

Invoking the intent

Depending on how your account collects UPI, intent_uri comes either as a complete URI (upi://pay?pa=...) or as its query string alone (pa=...&pn=...). Handle both: if it does not start with upi://, prefix it with upi://pay? before invoking it, and never add a second scheme. See the integration guide for Android, iOS and desktop handling.

Errors

Refusals use the standard envelope: success is false, and error carries a code, a message and details. A 400 always carries ERR_ORDER_002 — read details to see what failed and fix that field before retrying.
Duplicate reference_id

Duplicate requests

  • reference_id is single-use. It must be unique across all your orders, whatever their status — a failed order still holds its reference_id. Sending one that is already used is refused with Reference ID already exists; the original order is not returned.
  • invoice.number is unique across your orders that have not failed. Once an order fails, its invoice number can be used again.
  • For a PSP, both rules apply per sub-merchant.

After creating the order

  • Hosted Checkout. Load the EximPe JS SDK on your page and call eximpe.checkout({ sessionId }) within 15 minutes. The customer is sent to your return_url whether the payment succeeds, fails or is cancelled.
  • S2S UPI Intent. Invoke the intent_uri on the customer’s device before expires_at.
  • Confirm the outcome from your backend. Never trust the redirect or the UPI app alone: check the Order Status API or wait for the Payment Successful webhook.
Integration guides: Hosted Checkout · S2S UPI Intent

Authorizations

X-Client-ID
string
header
required

Client Application ID - Your unique application identifier used to authenticate API requests. You can find your Client ID in the Developer Settings section of the merchant dashboard.

X-Client-Secret
string
header
required

Client Secret Key - Your secret key used alongside the Client ID for secure authentication. Keep this confidential and never expose it in client-side code. Available in the Developer Settings section of the merchant dashboard.

Headers

X-API-Version
enum<string>
default:3.0.0

The API version you integrate against. Send 3.0.0 for v3. It is a version selector, not a credential.

Available options:
3.0.0

Body

application/json

Order creation request

amount
string
required

Amount in rupees, as a decimal string such as "1000.00". A JSON number is also accepted. More than two decimal places are rounded to two, so 1000.456 is charged as 1000.46. Must be greater than 0 and at most 10,000,000.00.

Example:

"1000.00"

currency
enum<string>
required

ISO 4217 currency code. Hosted Checkout and S2S UPI Intent collect in INR only.

Available options:
INR
reference_id
string
required

Your reference for the order: letters, numbers and hyphens only. Must be unique across your orders, including failed ones.

Required string length: 1 - 50
Pattern: ^[A-Za-z0-9-]+$
Example:

"ORDER-123456"

collection_mode
enum<string>
required

Mode of payment collection. Required — there is no server-side default.

Available options:
hosted_payment,
s2s
buyer
object
required
product
object
required
invoice
object
required
return_url
string<uri>

Optional. Where Hosted Checkout sends the customer when the payment finishes. Without it the customer sees EximPe's own result page. S2S UPI Intent does not redirect the customer.

Maximum string length: 500
mop_type
enum<string>

Hosted Checkout: optional, pre-selects a payment method on the payment page. S2S UPI Intent: must be upi.

Available options:
credit_card,
debit_card,
upi,
net_banking,
qr
upi_flow_type
enum<string>

Required for S2S UPI Intent, where it must be intent. Not used by Hosted Checkout.

Available options:
intent
business_model
enum<string>

Whether the buyer is a business (B2B) or a consumer (B2C). Optional — derived from the merchant's KYC when omitted.

Available options:
B2B,
B2C
purpose_code
string

FEMA/FETERS purpose code this order settles under (e.g. S0802). Optional — derived from the merchant's allowed purpose codes when omitted and exactly one is allowed.

Example:

"S0802"

Response

Order created

success
boolean
required

Indicates if the request was successful

message
string
required

Response message

data
object
required