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
, first_name
, given_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
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
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": "order2314",
"is_payment_link": true,
"customer": {
"email": "jude.casper@durianpay.id"
}
}'
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