Dark Mode

Create Orders API


The following endpoint creates an Order

/orders

Run in Postman

Request Attributes

amount

String
Mandatory

The amount for which the Order was created. Example: "10000" or "10000.23" for amount with decimal value

currency

String
Mandatory

The currency associated with the Order's amount. Example: "IDR"

customer

Object
Mandatory
json 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.

address is mandatory to use BNPL payment method.

Hide customer object

FieldTypeDescription

idMandatory

string

The customer ID from Durianpay

emailMandatory

string

The customer's email address. Should of the format jane.doe@gmail.com and should not contain any invalid special characters (¢,£,§,©,etc)

mobileMandatory

string

The customer's mobile number. Please ensure that the number follows Indonesia's phone number format : +62xxxxxxxxxx or 08xxxxxxxxxx.

first_nameOptional

string

The customer's first name

given_nameOptional

string

The customer's given name

addressOptional

object

The address fields includes receiver_name, receiver_phone, label, address_line, city, region, postal_code, landmark

Hide address object

receiver_name

Optional
string

The receiver's name

receiver_phone

Optional
string

The receiver's phone number

label

Optional
string

The label for the address

address_line

Optional
string

The address' line

city

Optional
string

The receiver's city

region

Optional
string

The address' region

postal_code

Optional
string

The address' postal code

landmark

Optional
string

The address' landmark

customer_ref_idOptional

string

The customer ID from the merchant

payment_option

String
Optional

The type of payment option with which order was created. Example: "full_payment" or "installment"

order_ref_id

String
Optional

The unique identifier of Order from the merchant. Example: "INV/1/2021"

items

Array
Optional

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

FieldTypeDescription

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

metadata

Object
Optional

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

Timestamp
Optional

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"

Example
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 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"
        }
    ],
    "metadata": {
        "my-meta-key": "my-meta-value",
        "SettlementGroup": "BranchName"
    },
    "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",
        "address_id": 7526,
        "fees": null,
        "shipping_fee": "",
        "admin_fee_method": "included"
    }
}

400 - Invalid Request

401 - Unauthorized Access