Create Promos API
Request Attributes
amount
The amount for which the Promo was created
currency
The currency associated with the Promo's amount
label
The label you want to attach with the promotion, has to be unique
type
valid values are "card_promos", "ewallet_promos", "va_promos"
sub_type
valid values are "direct_discount", "cashback"
min_order_amount
denoting minimum order amount on which promo should apply
max_discount_amount
denoting maximum discount amount which promo should generate
starts_at
ends_at
discount
Depending on discount_type
, value is either %discount or flat discount
discount_type
valid values are "percentage", "flat"
limit_type
valid values are "quota", "budget".
price_deduction_type
valid values are "total_price", "product_price", "shipping_price"
promo_details
Denoting the metadata specific to promo type
Description
Description of the promotion
Note: Please note that out of bin_list
and bank_codes
at-least one should be present if promo includes card_promo
curl -X POST \
https://api.durianpay.id/v1/merchants/promos \
-H 'authorization: [Base64({Your_Server_Key}:)]' \
-H 'content-type: application/json' \
-d '{
"type": "card_promos",
"label": "SALE502022",
"currency": "IDR",
"promo_details": {
"bin_list":[424242],
"bank_codes":[]
},
"discount_type": "percentage",
"discount": "10",
"min_order_amount": "",
"max_discount_amount": "",
"starts_at": "2022-02-24T18:30:00.000Z",
"ends_at": "2022-02-27T18:30:00.000Z",
"promo_type": "",
"description": "",
"sub_type": "direct_discount",
"limit_type": "quota",
"limit_value": "100",
"price_deduction_type": "total_price",
"code": "SALE2022"
}'
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 31
{ "data": { "currency": "IDR", "label": "SALE50202", "description": "", "min_order_amount": "", "max_discount_amount": "", "starts_at": "2022-02-24T18:30:00Z", "ends_at": "2022-02-27T18:30:00Z", "discount": "10", "discount_type": "percentage", "type": "card_promos", "promo_details": { "promo_id": "prm_rdrZVRIhcq5927", "bin_list": [ 424242 ], "bank_codes": [] }, "sub_type": "direct_discount", "limit_type": "quota", "limit_value": "100", "price_deduction_type": "total_price", "status": "expired", "created_at": "2022-03-06T21:55:43.412583Z", "updated_at": "2022-03-06T21:55:43.412583Z", "is_live": true, "promo_usage": "", "id": "prm_rdrZVRIhcq5927" } }
400 - Invalid Request
401 - Unauthorized Access
500 - Internal Server Error