Create Orders API
Request Attributes
amount
The amount for which the Order was created. Example: "10000"
or "10000.23"
for amount with decimal value
currency
The currency associated with the Order's amount. Example: "IDR"
customer
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
. address
is mandatory
to use BNPL
payment method.
Hide customer object
Field | Type | Description |
---|---|---|
idMandatory | string | The customer ID from Durianpay |
emailMandatory | string | The customer's email address. Should of the format |
mobileMandatory | string | The customer's mobile number. Please ensure that the number follows Indonesia's phone number format : |
given_nameOptional | string | The customer's given name |
middle_nameOptional | string | The customer's middle name |
sur_nameOptional | string | The customer's surname |
addressOptional | object | The address fields includes receiver_name, receiver_phone, label, address_line, city, region, postal_code, landmark Hide address object receiver_nameOptional string The receiver's name receiver_phoneOptional string The receiver's phone number labelOptional string The label for the address address_lineOptional string The address' line cityOptional string The receiver's city regionOptional string The address' region postal_codeOptional string The address' postal code landmarkOptional string The address' landmark |
customer_ref_idOptional | string | The customer ID from the merchant |
payment_option
The type of payment option with which order was created. Example: "full_payment"
or "installment"
order_ref_id
The unique identifier of Order from the merchant. Example: "INV/1/2021"
items
Array of objects with each object including name, brand, category, sku, price, qty, total_price.mandatory
to use BNPL
and LINKAJA
payment method
Hide items object
Field | Type | Description |
---|---|---|
nameMandatory | string | The item's name |
quantityMandatory | string | The quantity of the item |
priceMandatory | string | The price for a single item |
logoOptional | string | The logo of the item |
brandOptional | string | The brand of the item |
categoryOptional | string | The category of the item |
skuOptional | string | The SKU (Stock Keeping Unit) of the item |
total_priceOptional | string | The total price of the item |
metadataOptional | string | The metadata of the item |
description
String to store description of the order. Example: { "note": "This order is delicate. Handle With Care!" }
admin_fee_method
Used to specify if the transactional charges are to be included and paid by the merchant or customer.
For Example:
Possible Values:
"included" - Transaction Fee is paid by merchant
"excluded" - Transaction Fee is paid by customer
metadata
Key-Value pair that can be used to store additional information about the entity. e.g. note
: Force is with this order
. Example: { "note": "Force is with this order" }
expiry_date
The time stamp at which the order will expire. Please ensure that the value is in RFC3339 format. Example: "2022-03-29T10:00:00.000Z"
curl -X POST \
https://api.durianpay.id/v1/orders \
-H 'authorization: [Base64({Your_Server_Key}:)]' \
-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",
"middle_name": "Mary",
"sur_name": "Doe",
"email": "jane_doe@nomail.com",
"mobile": "85722173217",
"address": {
"receiver_name": "Jude Casper",
"receiver_phone": "8987654321",
"label": "Home 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/tv_image.jpg",
"brand": "Samsung",
"category": "Electronics",
"sku": "TV_123",
"total_price": "10001.00",
"metadata": "Model No: SG_123"
}
],
"metadata": {},
"description": "Pesan untuk TV",
"admin_fee_method": "included",
"expiry_date": "2022-03-29T10:00:00.000Z"
}'
Response Code
200 - Success
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
{ "data": { "id": "ord_0dIWbuDJQ84078", "customer_id": "cus_ViPeX4iBYp2233", "order_ref_id": "order_ref_001", "order_ds_ref_id": "", "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", "expiry_date": "2022-03-29T10:00:00Z", "metadata": { "my-meta-key": "my-meta-value", "SettlementGroup": "BranchName" }, "items": [ { "name": "LED Television", "qty": 1, "price": "10001.00", "logo": "https://merchant.com/tv_image.jpg" } ], "access_token": "adsyoi12sdASd123ASX@qqsda231", "expire_time": "2022-09-15T13:40:17.064478772Z", "is_live": true, "fees": null, "shipping_fee": "", "admin_fee_method": "included" } }
400 - Invalid Request
401 - Unauthorized Access