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",
  "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": "Order created successfully",
  "data": {
    "session_id": "session_abc123def456",
    "order_id": "order_xyz789uvw012"
  }
}

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

The body is of type object.

Response

200
application/json

Order created successfully

The response is of type object.