Update Promos API
Path Attributes
id
Unique identifier of the Promo to be retrieved
Request Attributes
Following are the parameters to be sent in the request body:
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 PATCH \
https://api.durianpay.id/v1/merchants/promos/prm_JaQGjzJDdz0460 \
-H 'authorization: [Base64({Your_Server_Key}:)]' \
-H 'content-type: application/json' \
-d '{
"type":"card_promos",
"label":"SALE302022",
"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
{ "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" }
400 - Invalid Request
401 - Unauthorized Access
500 - Internal Server Error