Skip to main content

Check Promo Code

This API endpoint allows users to check if a given promo code is valid or not. It takes the promo code as an input and returns the details about the promo code, such as the discount percentage, expiration date, and any restrictions on usage.

  • Endpoint: api/customer/orders/check_promo_v2

  • Method: POST

tip

This API requires the customer to have a verified phone number. If the customer's phone number has not been verified, a status code of 409 will be returned.

  • Request Parameters:

    • promo (required): The promo code to check.
    • verification_code: The verification code sent to the customer's phone number. This parameter is required if the customer's phone number has not been verified.
  • Response Status Codes:

    • 200 OK The promo code is valid.
    • 409 the customer's phone number has not been verified.
  • Success Response:

KeyTypeDescription
itemsArrayan array that typically contains the items present in the customer's cart. It indicates the specific items that are affected by the promo code, along with their associated details.
amountIntegerthe total amount after applying any discounts or promotions related to the promo code.
total_amountIntegerthe original total amount before applying any discounts or promotions related to the promo code.
discountIntegerthe amount of discount applied to the total_amount.
free_deliveryBooleanA boolean value indicating whether free delivery is available when the promo code is applied.
exclusive_priceBooleanA boolean value indicating whether the promo code offers an exclusive price for the items.
referalBooleanA boolean value indicating whether the promo code is a referral code.
payment_methodsArrayan array of available payment methods for the transaction. The array would typically include objects containing information about each payment method as eligible for promo code discounts or if any restrictions apply.
remove_promotionsBooleanA boolean value indicating whether applying the promo code removes all other item discounts.
removed_promotion_hintStringA string providing a hint explaining that applying this specific promo code will remove all other item discounts.
{
"code": 200,
"data": {
"amount": 13899,
"free_delivery": true,
"referal": false,
"payment_methods": [
{
"id": 2,
"name": "Credit / Debit card",
"name_ar": " بطاقة الائتمان \\ الخصم المباشر",
"is_online": 1,
"type": 0,
"icon": "https://127.0.0.1:8000/images/payment_methods/credit_payment.png",
"plans": []
},
//...
]
}
}
info

Check the following section to learn more about the Check Promo V2 API Reference