Create Payment Link API
Request Attributes
Following are the parameters to be sent in the request body:
amount
The amount for which the Order was created
currency
The currency associated with the Order's amount
is_payment_link
Boolean flag denoting its a payment link order
customer
The customer fields including id
, email
, mobile
, given_name
, middle_name
, sur_name
, address_line_1
, address_line_2
, city
, region
, country
, postal_code
, customer_ref_id
. One of id
, mobile
, email
is mandatory
field whereas others are optional
. address is mandatory
for BNPL
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
items
Array of objects with each object including name
, brand
, category
, sku
, price
, qty
, total_price
. mandatory
for BNPL and LINKAJA
description
String to store description of the order. Example: { "note": "This order is delicate. Handle With Care!" }
metadata
Key-Value pair that can be used to store additional information about the entity. e.g. {"note":"Force is with this order"}
is_notification_enabled
Boolean flag to send notification email to the customer
email_subject
If the is_notification_enabled
set true, the text in this field will be used as the notification email's subject
email_content
If the is_notification_enabled
set true, the text in this field will be used as the notification email's body
curl -X POST
https://api.durianpay.id/v1/orders \
-H 'authorization: [Base64({Your_Server_Key}:)]' \
-H 'content-type: application/json' \
-d '{
"amount": "20000",
"currency": "IDR",
"order_ref_id": "order_ref_001",
"is_payment_link": true,
"payment_option": "full_payment",
"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",
"is_notification_enabled": true,
"email_subject": "this is email subject",
"email_content": "this is email content"
}'
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
{ "data": { "id": "ord_A31sd3AwAgItmmXdp", "amount": "20000", "customer_id": "cus_abcd1234", "currency": "IDR", "status": "started", "order_ref_id": "order2314", "order_ds_ref_id": "", "created_at": 1582628071, "payment_link_url": "d123ASX@qqsdaDasdd123ASX@qqsda", "metadata": [], "access_token": "adsyoi12sdASd123ASX@qqsda231", "payment_option": "full_payment", "pending_amount": null, "address_id": 7526, "fees": null, "shipping_fee": "", "admin_fee_method": "included" } } // redirect user to // https://links.durianpay.id/payment/{payment_link_url})
400 - Invalid Request
401 - Unauthorized Access