POST
/
api
/
v2
/
order
/
create
curl --request POST \
  --url https://api.paytring.com/api/v2/order/create \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '{
  "key": "test_123",
  "amount": 100,
  "cname": "Jhon Doe",
  "phone": "9897969594",
  "receipt_id": "xx00011",
  "callback_url": "https://httpbin.org/post",
  "hash": "<string>",
  "email": "<string>",
  "currency": "INR",
  "billing_address": {
    "line1": "<string>",
    "line2": "<string>",
    "city": "<string>",
    "state": "<string>",
    "zipcode": 123,
    "country": "<string>",
    "phone": "<string>",
    "firstname": "<string>",
    "lastname": "<string>"
  },
  "shipping_address": {
    "line1": "<string>",
    "line2": "<string>",
    "city": "<string>",
    "state": "<string>",
    "zipcode": 123,
    "country": "<string>",
    "phone": "<string>",
    "firstname": "<string>",
    "lastname": "<string>"
  },
  "notes": {
    "udf1": "<string>",
    "udf2": "<string>",
    "udf3": "<string>",
    "udf4": "<string>",
    "udf5": "<string>"
  },
  "pg": "<string>",
  "pg_pool_id": "<string>",
  "tpv": [
    {
      "account_number": "<string>",
      "name": "<string>",
      "ifsc": "<string>"
    }
  ],
  "split_settlement": [
    {
      "vendor_id": "<string>",
      "amount": "<string>"
    }
  ],
  "split_type": "percent",
  "autocapture": "true"
}'
"{\n  \"status\": true,\n  \"url\": \"aHR0cHM6Ly91YXQubWNzYW0uaW4vcGVnYXN1cy9hc0b2tlbi80ODg2NDUxNjAxODQzMTYwMTE=\",\n  \"order_id\": \"48864xxxxxxxxxx\"\n}"

This API is used to initiate a payment request for a specific order.

Request Body

{
  "email": "string", // End User Email
  "callback_url": "https://httpbin.org/post", // Default callback URL
  "currency": "INR", // Default currency
  "pg": "string", // Payment gateway code (optional)
  "pg_pool_id": "string", // Payment gateway pool ID (optional)
  "hash": "string" // Calculated hash for request validation
}

Responses

200 OK

{
  "status": true,
  "order_id": "string",
  "message": "Order created successfully"
}

400 Bad Request

{
  "status": false,
  "error": {
    "message": "Invalid request",
    "code": 400
  }
}

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Body

application/json
key
string
default:test_123
required

Merchant key, available in dashboard profile section

amount
integer
default:100
required

Amount will always be in paisa/cents.

cname
string
default:Jhon Doe
required

End User/Payes Name

phone
string
default:9897969594
required

End Users Phone

receipt_id
string
default:xx00011
required

a random string a sting provided by merchant for reference.

callback_url
string
default:https://httpbin.org/post
required

callback url of merchant website on which will we redirect to , once payment is done.

hash
string
required

to be calculated by key sort of all non-object key values of this request

email
string
required

End User Email

currency
string
default:INR

Please Get Currency Active by our team

billing_address
object
shipping_address
object
notes
object

These fields can be used for reporting

pg
string

if you pass a pg code then only that payment gateway will be used to process this transection. eg, payu

pg_pool_id
string

this can be grabbed from pg integration manager available in your dashboard..

tpv
object[]

add tpv info

split_settlement
object[]
split_type
enum<string>
default:percent
Available options:
"percent",
"fixed"
autocapture
string
default:true

if merchant wan't they can disable autocapture by sending false in request

Response

200
application/json
200
status
boolean
default:true
Example:

true

url
string
Example:

"aHR0cHM6Ly91YXQubWNzYW0uaW4vcGVnYXN1cy9hc0b2tlbi80ODg2NDUxNjAxODQzMTYwMTE="

order_id
string
Example:

"48864xxxxxxxxxx"