Skip to main content

Create Promos API

Create an Order#

The following endpoint creates an Promo:

/merchants/promos

Request parameters#

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

Fieldis required?Description
amountmandatorystring The amount for which the Promo was created
currencymandatorystring The currency associated with the Promo's amount
labelmandatorystring The label you want to attach with the promotion, has to be unique
descriptionoptionalstring Description of the promotion
typemandatorystring valid values are "card_promos", "ewallet_promos", "va_promos"
sub_typemandatorystring valid values are "direct_discount", "cashback"
min_order_amountmandatorystring denoting minimum order amount on which promo should apply
max_discount_amountmandatorystring denoting maximum discount amount which promo should generate
starts_atmandatorystring
ends_atmandatorystring
discountmandatorystring Depending on discount_type, value is either %discount or flat discount
discount_typemandatorystring valid values are "percentage", "flat"
limit_typemandatorystring valid values are "quota", "budget"
price_deduction_typemandatorystring valid values are "total_price", "product_price", "shipping_price"
promo_detailsmandatoryobject Denoting the metdata specific to promo type

Example#

curl -u <YOUR_SECRET_KEY> \
-X POST https://api.durianpay.id/v1/merchants/promos \
-H "content-type: application/json" \
-d '{
"currency": "IDR",
"label": "PROMO1",
"description": "",
"code": "PROMO1",
"starts_at": "2015-05-05T12:30:00",
"ends_at": "2015-05-08T12:30:00",
"min_order_amount": "0",
"max_discount_amount": "75",
"type": "card_promos",
"promo_details": {
"bin_list": [12, 23],
"bank_codes": ["BCA"]
},
"discount": "30",
"discount_type": "percentage",
"limit_type": "quota",
"limit": 50,
"sub_type": "direct_discount",
"price_deduction_type": "total_price"
}'

Response#

{
"id": "prm_XXXXXXXX",
"currency": "IDR",
"label": "PROMO1",
"description": "",
"code": "PROMO1",
"status": "expired",
"starts_at": "2015-05-05T12:30:00",
"ends_at": "2015-05-08T12:30:00",
"min_order_amount": "0",
"max_discount_amount": "75",
"type": "card_promos",
"promo_details": {
"bin_list": [12, 23],
"bank_codes": ["BCA"]
},
"discount": "30",
"discount_type": "percentage",
"limit_type": "quota",
"limit": 50,
"sub_type": "direct_discount",
"price_deduction_type": "total_price"
}