Skip to main content
POST
/
pg
/
orders
curl --request POST \
  --url https://api-staging.eximpe.com/pg/orders/ \
  --header 'Content-Type: application/json' \
  --header 'X-Client-ID: <api-key>' \
  --header 'X-Client-Secret: <api-key>' \
  --header 'X-Merchant-ID: <api-key>' \
  --data '
{
  "amount": "1000.00",
  "currency": "INR",
  "reference_id": "ORDER_123456",
  "return_url": "https://yourdomain.com/payment/callback",
  "collection_mode": "hosted_payment",
  "mop_type": "UPI",
  "buyer": {
    "name": "Alice Smith",
    "email": "alice.smith@example.com",
    "phone": "+919812345678",
    "address": {
      "line_1": "221B Baker Street",
      "line_2": "Near Central Park",
      "city": "Mumbai",
      "state": "Maharashtra",
      "postal_code": "400001"
    }
  },
  "product": {
    "name": "Wireless Headphones",
    "description": "Noise-cancelling over-ear headphones",
    "hs_code": "85183000",
    "hs_code_description": "Headphones and earphones, whether or not combined with a microphone",
    "type_of_goods": "goods"
  },
  "invoice": {
    "number": "INV_20240621",
    "date": "2024-06-21"
  }
}
'
{
"success": true,
"message": "Checkout session created successfully",
"data": {
"session_id": "session_abc123def456",
"order_id": "OD2000992103"
}
}

Overview

The Create Order endpoint is the first step in the payment flow. It creates a new order with all the necessary details including buyer information, product details, and payment preferences. After creating an order successfully, you’ll receive a session_id and order_id. Use the session_id to redirect the customer to the payment gateway for completing the transaction.

Authorizations

X-Client-ID
string
header
required

Client app ID. You can find your app id in the merchant dashboard.

X-Client-Secret
string
header
required

Client secret key. You can find your secret in the merchant dashboard.

X-Merchant-ID
string
header
required

Merchant ID. You can find your merchant ID in the merchant section of the merchant dashboard.

Body

application/json

Order creation request

amount
string
required

Amount in decimal format (e.g., "100.00")

currency
string
required

3-letter ISO currency code (e.g., INR, USD)

reference_id
string
required

Unique identifier for the order

buyer
object
required
product
object
required
return_url
string<uri>

URL to redirect after payment

collection_mode
enum<string>

Payment collection mode

Available options:
hosted_payment,
s2s
mop_type
enum<string>

Method of payment type (e.g., UPI)

Available options:
UPI,
CREDIT_CARD,
NETBANKING,
DEBIT_CARD,
QR
upi_flow_type
enum<string>

UPI flow type (required when collection_mode is s2s and mop_type is UPI)

Available options:
intent,
collection
vpa
string

Virtual Payment Address (required when upi_flow_type is collection)

upi_app_name
enum<string>

UPI app name (optional, defaults to 'others')

Available options:
bhim,
paytm,
google_pay,
phonepe,
cred,
amazon_pay,
whatsapp,
others
invoice
object

Response

Order created successfully

success
boolean
required

Indicates if the request was successful

message
string
required

Response message

data
object
required