Dark Mode

Creating orders for sub accounts


The following endpoint can be used to create an order for your sub account.

/orders

This API is an extension of the Create Order API.

The sub account for which the order is being created must be specified in the header of the request. Fund route details are mandatory when creating an order for sub account.

transfer_to_sub_account

String
Optional

Amount that you want to be settled to the sub account directly. This must be <= the order amount

remaining_amount_destination

String
Optional

MASTER_MERCHANT_BANK_ACCOUNT. This specifies that the remaining amount will be transferred to the master account's bank account

Example
# for creating orders for sub accounts
curl -X POST \
  https://api.durianpay.id/v1/orders \
  -H 'Authorization: [Base64({Your_Server_Key}:)]' \
  -H 'Sub-Account-ID: [Sub_Account_ID]' \
  -H 'Content-Type: application/json' \
  -d '{
    "amount": "10000",
    "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"
  }
},
    "fund_route_details": {
    "transfer_to_sub_merchant": "10000",
    "remaining_amount_destination": "MASTER_MERCHANT_DISBURSEMENT_BALANCE"
}
    "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"
},
    "expiry_date": "2022-12-12T10: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
{
"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",
    "expiry_date": "2022-03-29T10:00:00Z",
    "metadata": {
        "my-meta-key": "my-meta-value",
        "SettlementGroup": "BranchName",
        "fund_route_details": {
            "transfer_to_sub_merchant": "10000",
            "remaining_amount_destination": "MASTER_MERCHANT_BANK_ACCOUNT"
        },
        "master_account_id": "mer_MsCtIPhqRc8045"
    },
    "items": [{
        "name": "LED Television",
        "qty": 1,
        "price": "10001.00",
        "logo": "https://merchant.com/product_001/tv_image.jpg"
      }],
    "access_token": "adsyoi12sdASd123ASX@qqsda231"
    }
}