Skip to main content
Version: 3.2.0

Order

Our Order API endpoints provide a secure and efficient solution for managing ecommerce transactions. They allow for the storage and retrieval of order details, generation of orders, and facilitate updates to orders, aiding smooth operations for merchants and their connected systems.

info
  • Authentication required: These endpoints require authentication. To learn how to authenticate, see our authentication documentation.
  • Sample requests & responses: To test these endpoints with sample requests, use our Postman collection
  • Swagger file: To view definitions for these endpoints, see our swagger file

POST Order

Securely stores order_details, and returns an order_token. This endpoint does not perform validation, only storage/vaulting.

You can use /charge?action = validate if you want these order_details validated by the vault or a connected business system.

Endpoint

/order_token

Sample Messages

Sample Request
{
"order_request": {
"details_format": "details",
"order_details": {
"order": {
"service_id": "{{service_id}}",
"order_amount": {
"value": 4000,
"currency": {
"name": "Indian Rupees",
"currency_code": "INR",
"decimal_places": 2,
"separator": true,
"symbol": "₹"
}
},
"customer": {
"entity_type": "person",
"details_format": "details",
"entity_details": {
"name": {
"full_name": "Company Name"
},
"email": "companyinfo@email.com",
"phone_number": {
"type": "mobile",
"details": {
"unformatted_number": "+913852543512"
}
}
}
},
"orchestration_id": "bdc731ca-192b-423e-a2b8-bde0b8b477d2"
}
}
}
}
Sample Response
{
"order_id": "955a26a3-aaaa-4fb9-a38e-439a804628b9",
"service_id": "6cf4a729-cb4f-4e60-8bee-3dee0f7b7a4f",
"order_amount": {
"value": 4000,
"currency": {
"currency_code": "INR"
}
},
"customer": {
"entity_id": "eed37ecd-90e3-4744-b6bf-ebdf5f4eba75",
"your_entity_reference": "",
"entity_type": "person",
"entity_details": {
"name": {
"first": "",
"middle": "",
"last": "",
"suffix": "",
"prefix": "",
"full_name": "Company Name"
},
"addresses": null,
"email": "companyinfo@email.com",
"phone_number": {
"type": "mobile",
"details": {
"country_code": "",
"unformatted_number": "+913852543512",
"formatted_number": ""
},
"your_phone_number_reference": ""
}
}
},
"your_order_reference": "",
"order_line_items": []
}

GET Order Details

Returns the details of an order.

Endpoint

/order_token/{order_token}

Parameters

NameValueRequiredExplanation
order_token{order_token}YesA unique reference to an order

Sample Messages

Sample Response
{
"order_id": "11d4a0d5-34ed-4193-8cde-a19e591a736a",
"service_id": "e3fa2406-30a4-4c67-825f-a968710c7016",
"order_amount": {
"value": 4000,
"currency": {
"currency_code": "INR"
}
},
"customer": {
"entity_id": "afc84ddc-706e-4515-828f-4d913360cb13",
"your_entity_reference": "",
"entity_type": "person",
"entity_details": {
"name": {
"first": "",
"middle": "",
"last": "",
"suffix": "",
"prefix": "",
"full_name": "Company Name"
},
"addresses": [
{
"type": "shipping",
"details": {
"line_1": "Suite 1, Level 29/100 Barangaroo Ave",
"line_2": "",
"line_3": "",
"postal_code": "2000",
"city": "Barangaroo",
"state_region_province": "NSW",
"country": "AU",
"your_address_reference": ""
}
}
],
"email": "companyinfo@email.com",
"phone_number": {
"type": "mobile",
"details": {
"country_code": "61",
"unformatted_number": "490000000",
"formatted_number": "0490000000"
},
"your_phone_number_reference": ""
}
}
},
"your_order_reference": "",
"order_line_items": []
}

POST Update Order

Updates details of an order.

Endpoint

/order_token/\{order_token\}

Parameters

NameValueRequiredExplanation
order_token{order_token}YesA unique reference to an order

Sample Messages

Sample Request
{
"entity_type": "person",
"details_format": "details",
"entity_details": {
"name": {
"first": "NewFirstName",
"middle": "",
"last": "Roger",
"suffix": "",
"prefix": ""
},
"addresses": [
{
"type": "billing",
"details": {
"line_1": "2100 Alamo Rd",
"line_2": "Suite T",
"line_3": "mailbox 123",
"postal_code": "75080",
"city": "Richardson",
"state_region_province": "TX",
"country": "US",
"your_address_reference": "string"
}
}
],
"email": "user@example.com",
"phone_number": {
"type": "mobile",
"details": {
"country_code": "IR",
"unformatted_number": "123456789",
"formatted_number": "333"
},
"your_phone_number_reference": "string"
}
}
}
Sample Response
{
"entity_id": "6ef9c24e-55ce-4212-8112-bf410c0e0d04",
"your_entity_reference": "",
"entity_type": "details",
"entity_details": {
"digital_addresses": [
{
"details": "user@example.com",
"type": "email"
}
],
"names": [
{
"details": "NewFirstName",
"type": "first_name"
},
{
"details": "Roger",
"type": "last_name"
}
],
"phone_numbers": [
{
"details": {
"country_code": "IR",
"formatted_number": "333",
"e164_number": "123456789"
},
"type": "mobile"
}
],
"physical_addresses": [
{
"details": {
"city": "Richardson",
"country": "US",
"line_1": "2100 Alamo Rd",
"line_2": "Suite T",
"line_3": "mailbox 123",
"postal_code": "75080",
"state_region_province": "TX"
},
"type": "billing",
"your_physical_address_reference": "string"
}
]
}
}

HTTP Response Codes

Below is a table summarizing the various HTTP response codes and their descriptions.

HTTP Status CodeResponse SchemaDescription
200ChargeThe charge response provides the status of the most recent charge event and ledger balances and tokens for the payment, order, and settlement (if available).
201Charge PendingThe pending charge response provides the pending status of the most recent charge event.
202Charge Money ErrorThe money error charge response provides error information about the most recent charge event, which had a money error. Please review the error fields to determine how to resolve this error.
203Charge Connectivity ErrorThe connector error charge response provides error information about the most recent charge event, which had a connector error. Please review the error fields to determine how to resolve this error.
211Charge Data ErrorThe charge error response provides error information and the status of the charge as well as balances for the payment, order, and settlement (if available) ledgers. Also provided are the token references for the associated payment, order, session, and entity tokens.
400Charge Request ErrorThe request error charge response provides error information about the most recent API request, which contained a schema error. Please review the error fields to determine how to resolve this error.
500System ErrorAn error occurred either within /charge or externally in a system Connected to /charge. Please notify DataMesh via ecomm@datameshgroup.com.