Promos Fetch API


The following endpoint retrieves the details of all Promos created

/merchants/promos

Example

curl -X GET \
  https://api.durianpay.id/v1/merchants/promos \
  -H 'authorization: [Base64({Your_Server_Key}:)]' \
  -H 'content-type: application/json' \

Response Code : 200

Here is an example of success response

{
  "data": [
    {
      "id": "prm_XXXXXXX",
      "currency": "IDR",
      "label": "PROMO1",
      "description": "",
      "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_dicsount",
      "price_deduction_type": "total_price"
    }
  ]
}

Error Response Code : 401

Here is an example error response for unauthorized access

{
    "error": "invalid Authorization header in request",
    "error_code": "DPAY_UNAUTHORIZED_ACCESS"
}

Error Response Code : 500

Here is an example error response for internal server error

{
  "error": "error getting promos",
  "error_code": "DPAY_INTERNAL_ERROR"
}