v1

latestOpenAPI 3.0.12026-07-2412502.6 MB
Discounts

Validate a discount

Check if the discount is valid for a specific offer.

post/discounts/validate

Request body

offer_idinteger required

Some discount codes are only available for specific offers. This value is required in order to validate the discount.

discount_codestring required

Discount code.

item_idinteger

Some discount codes are only available for specific items.

Response

OK

discount_idinteger
discount_namestring
discount_type_id1 | 2
  • 1 - One Time Code
  • 2 - Recurring Code
discount_application_type_id1 | 2
  • 1 - Offer Level
  • 2 - Cart Level
shipping_onlyboolean
discount_category_idinteger nullable
discount_codestring
discount_descriptionstring nullable
discount_activeboolean
discount_expiration_datestring date-time nullable
discount_one_per_customerboolean
discount_notesstring nullable

Example response

{
  "discount_expiration_date": "2023-04-01 00:00:00",
  "discount_offers": [
    {
      "date_created": "2023-04-01 00:00:00",
      "date_modified": "2023-04-01 00:00:00",
      "offer_cycles": [
        {
          "date_created": "2023-04-01 00:00:00",
          "date_modified": "2023-04-01 00:00:00",
          "offer_cycle_items": [
            {
              "date_created": "2023-04-01 00:00:00",
              "date_modified": "2023-04-01 00:00:00"
            }
          ],
          "charge_timeframe": {
            "date_created": "2023-04-01 00:00:00",
            "date_modified": "2023-04-01 00:00:00"
          }
        }
      ],
      "offer_timeframes": [
        {
          "date_created": "2023-04-01 00:00:00",
          "date_modified": "2023-04-01 00:00:00"
        }
      ],
      "offer_swap_options": [
        {
          "date_created": "2023-04-01 00:00:00",
          "date_modified": "2023-04-01 00:00:00"
        }
      ]
    }
  ]
}