Skip to main content

Create Orders API

Create an Order#

The following endpoint creates an Order:

/orders

Request parameters#

Following are the parameters to be sent in the request body:

Fieldis required?DescriptionExample
amountmandatorystring The amount for which the Order was created"10000" or "10000.23" for amount with decimal value
payment_optionoptionalstring The type of payment option with which order was created"full_payment" or "installment"
currencymandatorystring The currency associated with the Order's amount"IDR"
order_ref_idoptionalstring The unique identifier of Order from the merchant"INV/1/2021"
customermandatoryjson object The customer fields including id, email, mobile, first_name, given_name, address json object, customer_ref_id. One of id, mobile, email is mandatory field whereas others are optional.{ "email": "jane.doe@gmail.com" }
itemsoptionalarray Array of objects with each object including name, brand, category, sku, price, qty, total_price
metadataoptionaljson object Key-Value pair that can be used to store additional information about the entity. e.g. note: Force is with this order{ "note": "Force is with this order" }

Example#

curl -u <YOUR_SECRET_KEY> \
-X POST https://api.durianpay.id/v1/orders \
-H "content-type: application/json" \
-d '{
"amount": "10000.67",
"payment_option": "full_payment",
"currency": "IDR",
"order_ref_id": "order_ref_001",
"customer": {
"customer_ref_id": "cust_001",
"given_name": "Jane Doe",
"email": "jane_doe@nomail.com",
"mobile": "85722173217",
"address": {
"receiver_name": "Jude Casper",
"receiver_phone": "8987654321",
"label": "Jude's Address",
"address_line_1": "Jl. HR. Rasuna Said",
"address_line_2": "Apartment #786",
"city": "Jakarta Selatan",
"region": "Jakarta",
"country": "Indonesia",
"postal_code": "560008",
"landmark": "Kota Jakarta Selatan"
}
},
"items": [
{
"name": "LED Television",
"qty": 1,
"price": "10001.00",
"logo": "https://merchant.com/product_001/tv_image.jpg"
}
].
"metadata": {
"my-meta-key": "my-meta-value",
"SettlementGroup": "BranchName"
}
}'

Response#

{
"data": {
"id": "ord_0dIWbuDJQ84078",
"customer_id": "cus_ViPeX4iBYp2233",
"order_ref_id": "order_ref_001",
"amount": "10001.00",
"payment_option": "full_payment",
"currency": "IDR",
"status": "started",
"created_at": "2021-04-01T14:39:37.860426Z",
"updated_at": "2021-04-01T14:39:37.860426Z",
"metadata": {
"my-meta-key": "my-meta-value",
"SettlementGroup": "BranchName"
},
"items": [
{
"name": "LED Television",
"qty": 1,
"price": "10001.00",
"logo": "https://merchant.com/product_001/tv_image.jpg"
}
],
"access_token": "adsyoi12sdASd123ASX@qqsda231"
}
}