POST /coupons/channel/{channelLinkId}/coupons/{couponCode}/validate

Validate Coupons

Path parameters

  • channelLinkId string Required
  • couponCode string Required
application/json

Body

  • orderType integer Required

    Order type, according to the fulfillment type

    Values are 0, 1, 2, 3, or 4.

  • items array[object] Required
    Hide items attribute Show items attribute object
    • plu string Required
  • channel integer Required

    Default value is true.

  • channelLinkId string Required

    Default value is empty.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • code string Required

      Default value is MY-COUPON-1.

    • description string Required Deprecated

      Default value is My Coupon.

    • discounts array[object] Required
      Hide discounts attributes Show discounts attributes object
      • scope object Required
        Hide scope attributes Show scope attributes object
        • type string Required

          Values are order or product.

        • plus array[string]

          Array with the PLU codes (only required for product scope)

      • offer object
        Hide offer attributes Show offer attributes object
        • type string Required

          Values are flat_off, percent_off, or free.

        • value integer

          Only for flat_off

          Default value is 1234.

        • currency string

          Only for flat_off

          Default value is EUR.

        • display string

          Only for flat_off

          Default value is 12.45.

        • percentage number(float)

          Only for percent_off

          Default value is 4.5.

  • 422 application/json

    Unprocessable Entity

    Hide response attributes Show response attributes object
    • code string Required
    • message string Required
    • context object
POST /coupons/channel/{channelLinkId}/coupons/{couponCode}/validate
curl \
 --request POST 'https://api.staging.deliverect.com/coupons/channel/{channelLinkId}/coupons/{couponCode}/validate' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"code":"TEST123","type":"basket","isEnabled":true,"isHidden":false,"description":"my coupon","discounts":[{"type":"flat_off","value":500,"currency":"EUR"}],"conditions":[{"type":"max_uses_per_coupon","maxUsesPerCoupon":3},{"type":"locations","locationIds":["ObjectId"]}]}'
Request example
{
  "code": "TEST123",
  "type": "basket",
  "isEnabled": true,
  "isHidden": false,
  "description": "my coupon",
  "discounts": [
    {
      "type": "flat_off",
      "value": 500,
      "currency": "EUR"
    }
  ],
  "conditions": [
    {
      "type": "max_uses_per_coupon",
      "maxUsesPerCoupon": 3
    },
    {
      "type": "locations",
      "locationIds": [
        "ObjectId"
      ]
    }
  ]
}
Response examples (200)
{
  "discounts": [
    {
      "externalId": null,
      "offer": {
        "type": "flat_off",
        "value": 500,
        "currency": "EUR",
        "display": "5.00"
      },
      "scope": {
        "type": "order"
      }
    }
  ],
  "description": "my coupon",
  "code": "D24"
}
Response examples (422)
{
  "code": "error_code",
  "message": "Error message",
  "context": {}
}