Skip to main content

Create Instapay/Payment Link API

Create an Instapay link#

The following endpoint creates an Order:

/orders

Request parameters#

Following are the parameters to be sent in the request body:

Fieldis required?Description
amountmandatorystring The amount for which the Order was created
currencymandatorystring The currency associated with the Order's amount
order_ref_idoptionalstring The unique identifier of Order from the merchant
is_payment_linkmandatorytrue Boolean flag denoting its a payment link order
customermandatoryjson object 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.
itemsoptionalarray Array of objects with each object including name, brand, category, sku, price, qty, total_price
metadataoptionaljson object Key-Value pair that can be used to store additional information about the entity. e.g. note: Force is with this order
is_notification_enabledoptionalfalse Boolean flag to send notification email to the customer
email_subjectoptionalstring if the is_notification_enabled set true, the text in this field will be used as the notification email's subject
email_contentoptionalstring if the is_notification_enabled set true, the text in this field will be used as the notification email's body

Example#

curl -u <YOUR_SECRET_KEY> \
-X POST https://api.durianpay.id/v1/orders \
-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#

{
"data": {
"id": "ord_A31sd3AwAgItmmXdp",
"amount": "20000",
"customer_id": "cus_abcd1234",
"currency": "IDR",
"status": "started",
"order_ref_id": "order2314",
"created_at": 1582628071,
"payment_link_url": "d123ASX@qqsdaDasdd123ASX@qqsda",
"metadata": [],
"access_token: "adsyoi12sdASd123ASX@qqsda231"
}
}
// redirect user to https://links.durianpay.id/payment/{payment_link_url})