younifyd
Menu

Get Rule Promotion Codes

Get Rule Promotion Codes

GET/v2/rule-promotions/{promotionID}/codes

Use it in a workflow

  1. Add a step and choose the Elastic Path connector.
  2. Pick the Get Rule Promotion Codes action (under Promotions Builder).
  3. Fill in the fields below, then reference the result from later steps as {{getRulePromotionCodes.response.data}}.

Request

Path parameters

promotionIDstringrequired

The unique identifier of the rule promotion.

Query parameters

filterstring

This parameter accepts a filtering expression that uses specific operators and attributes. Promotion codes are case-insensitive. The following operators and attributes are available when filtering on this endpoint. See [Supported Filtering Characters](/guides/Getting-Started/filtering#supported-characters). | Attribute | Type | Operator | Example | |:--------- |:---------|:------------|:---------------| | `code` | `string`, `number` | `eq`, `gt` | `eq(code,summer2024)`, `gt(code,2024)` |

sortstring

Specifies the order of the codes that will be returned.

One ofcode-code

Headers

Authorizationstring (Bearer)required

The Bearer token required to get access to the API.

Response

Returns 200 with an object. Read it in later steps with {{getRulePromotionCodes.response.data.<field>}}.

dataarray<object>
typestring
idstring (uuid)

Unique identifier for the promotion code

codestring
usesinteger
userstring
consume_unitstring

Specifies whether the code is consumed per application or per checkout. With `per_checkout`, the code is used once for each checkout, regardless of the number of items in the cart. When set to `per_application`, the code is used per application. For cart discounts, each application counts as one usage. For item discounts, each application to either a single quantity or a bundle is counted as one usage. For example, in a store that offers 50% off on SKU1, SKU2, and SKU3, and limits the maximum usage of the promotion code to two, a shopper can apply the promotion up to two quantities. If the cart contains two or more quantities of SKU1, the promotion is applied 2 times to SKU1, and other quantities and items are at the regular price. If the cart contains one quantity of SKU1, one quantity of SKU2, and one quantity of SKU3, the promotion is applied once to SKU1 and once to SKU2. The code usage is applied at checkout and the code is considered consumed at that point.

One ofper_applicationper_checkout

max_usesinteger
max_uses_per_shopperobject2 fields

Object for setting max uses per shopper. Only include this object, when you want to set limit per shopper.

is_for_new_shopperboolean
created_bystring
metaobject1 fields
linksobject
currentstring (uri)

URL for the current page of results

firststring (uri)

URL for the first page of results

laststring (uri)

URL for the last page of results

nextstring (uri)

URL for the next page of results

prevstring (uri)

URL for the previous page of results

metaobject
pageobject4 fields
resultsobject2 fields
json
{
  "data": [
    {
      "type": "string",
      "id": "00000000-0000-0000-0000-000000000000",
      "code": "string",
      "uses": 0,
      "user": "string",
      "consume_unit": "per_application",
      "max_uses": 0,
      "max_uses_per_shopper": {
        "max_uses": 0,
        "includes_guests": false
      },
      "is_for_new_shopper": false,
      "created_by": "string",
      "meta": {
        "timestamps": {
          "created_at": "2025-01-01T00:00:00Z"
        }
      }
    }
  ],
  "links": {
    "current": "string",
    "first": "string",
    "last": "string",
    "next": "string",
    "prev": "string"
  },
  "meta": {
    "page": {
      "current": 0,
      "limit": 0,
      "offset": 0,
      "total": 0
    },
    "results": {
      "total": 0,
      "total_method": "string"
    }
  }
}

Need more? See the Elastic Path guide for connection setup and behaviour shared by every action.