openapi: 3.0.0
info:
  title: Price Rules
  version: '2.0'
  description: |-
    The Price Rules API enables you to manage price rulesets.

    Refer to the <a href="https://developer.boldcommerce.com/changelog">changelog</a> for the latest updates to this API.
  termsOfService: https://boldcommerce.com/terms-of-service
  contact:
    name: Contact Us
    url: https://developer-dashboard.boldcommerce.com/default/contactus
servers:
  - url: https://api.boldcommerce.com
security:
  - OAuthToken: []
  - APIAccessToken: []
tags:
  - name: Rulesets
    description: Contains information about a [ruleset](/guides/price-rules/concepts/rulesets-and-rules#rulesets), including a rules list, actions, conditions, product selection, and start and end dates. Use these endpoints to manage rulesets on a store.
  - name: Rules
    description: A child of the Ruleset resource. Contains information about a [rule](/guides/price-rules/concepts/rulesets-and-rules#rules), including the type, conditions, and actions of the rule. Use these endpoints to manage the rules in a ruleset.
  - name: Order Conditions
    description: Child of the Ruleset resource. Contains information about the criteria for triggering actions in a ruleset. [Conditions](/guides/price-rules/references/conditions) are usually a `type:value` pair. Use these endpoints to manage the conditions in a ruleset.
  - name: Discount Codes
    description: Contains information about a discount on your store and the products that are eligible for it. Use these endpoints to manipulate the discount codes available on your store.
  - name: Storefronts
    description: Use these endpoints to get the final price for a product or cart after all rules have been applied.
  - name: Simple Communication Test
externalDocs:
  description: For more information about Price Rules, refer to the Overview.
  url: https://developer.boldcommerce.com/guides/price-rules
paths:
  /price_rules/rules/v2/shops/{shop_identifier}/rulesets:
    get:
      summary: List Rulesets
      operationId: ListRulesets
      tags:
        - Rulesets
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  data:
                    type: object
                    required:
                      - rulesets
                    properties:
                      rulesets:
                        type: array
                        description: Each set of rules that is related to the shop.
                        items:
                          $ref: '#/components/schemas/Ruleset'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
                required:
                  - message
                  - data
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                401-error-example:
                  value:
                    message: This request failed to be authenticated.
                    code: 00-1
                    type: authentication.failed
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                403-error-example:
                  value:
                    message: This request does not contain the necessary permissions to access the target endpoint.
                    code: 00-2
                    type: authorization.invalid_scopes
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                500-error-example:
                  value:
                    message: Error with fetching a ruleset
                    code: 04-0
                    type: unexpected
      description: List all rulesets available for the specified shop. This requires read_price_rulesets scope/permission. For more information about querying for certain rulesets, refer to the [Query and Pagination](/guides/price-rules/resources/query-pagination) guide.
      parameters:
        - schema:
            type: string
          in: query
          name: external_ids
          description: A list of ruleset external IDs that can be used as a filter in the search.
        - schema:
            type: string
          in: query
          name: fields
          description: List of the ruleset fields to be returned; if this parameter is empty, all the available fields will be included in the response.
        - schema:
            type: string
          in: query
          name: page
          description: Page number, considering that the results could span for several pages. Default is 1.
        - schema:
            type: string
          in: query
          name: limit
          description: Page size, considering that the results could span for several pages. Default is 50.
        - schema:
            type: boolean
          in: query
          name: include_all_apps
          description: The standard behaviour for this endpoint is to return just the rulesets that were created using the same auth token. To see all rulesets instead, this parameter should be set to true.
    parameters:
      - schema:
          type: string
        name: shop_identifier
        in: path
        required: true
        description: Bold platform identifier for the shop. Find this identifier using the [Get Shop Info](shops#operation/GetShopInfo) endpoint.
    post:
      summary: Create Ruleset
      operationId: CreateRuleset
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  data:
                    type: object
                    required:
                      - ruleset
                    properties:
                      ruleset:
                        type: object
                        items:
                          $ref: '#/components/schemas/BasicRuleset'
                required:
                  - message
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                400-error-example:
                  value:
                    message: 'Required field missing or empty: product_selection'
                    code: 04-6
                    type: price_rules.required_field_missing
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                401-error-example:
                  value:
                    message: This request failed to be authenticated.
                    code: 00-1
                    type: authentication.failed
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                403-error-example:
                  value:
                    message: This request does not contain the necessary permissions to access the target endpoint.
                    code: 00-2
                    type: authorization.invalid_scopes
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable Entity (WebDAV)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                422-error-example:
                  value:
                    message: Invalid ruleset in payload
                    code: 04-3
                    type: price_rules.invalid_payload
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      description: Create a new ruleset for the specified shop. This requires write_price_rulesets scope/permission.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                ruleset:
                  $ref: '#/components/schemas/BasicRuleset'
            examples:
              create-ruleset-example:
                value:
                  ruleset:
                    external_id: CreatedByAPI_1
                    internal_name: This ruleset was created by the API
                    product_selection:
                      type: SHOPIFY_PRODUCT_SEARCH
                      product_ids:
                        - '1234567890123'
                        - '1234567890987'
                    rules:
                      - type: DISCOUNT
                        conditions:
                          - type: CUSTOMER_GROUP
                            value: gold
                          - type: QTY_BY_PRODUCT
                            operator: '>='
                            value: 3
                        actions:
                          - type: PRICE_ADJUST_PERCENT
                            value: -10
                          - type: CHARM_PRICE
                            value: 99
      tags:
        - Rulesets
  /price_rules/rules/v2/shops/{shop_identifier}/rulesets/search:
    get:
      summary: List Rulesets for Shop
      operationId: ListRulesetsForShop
      tags:
        - Rulesets
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  data:
                    type: object
                    required:
                      - rulesets
                    properties:
                      rulesets:
                        type: array
                        description: Each set of rules that is related to the shop.
                        items:
                          $ref: '#/components/schemas/Ruleset'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
                required:
                  - message
                  - data
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                401-error-example:
                  value:
                    message: This request failed to be authenticated.
                    code: 00-1
                    type: authentication.failed
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                403-error-example:
                  value:
                    message: This request does not contain the necessary permissions to access the target endpoint.
                    code: 00-2
                    type: authorization.invalid_scopes
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                500-error-example:
                  value:
                    message: Error with fetching a ruleset
                    code: 04-0
                    type: unexpected
      description: List all rulesets available for the specified shop. This requires read_price_rulesets scope/permission.
      externalDocs:
        description: For more information on search filter options, please check our guides.
        url: https://developer.boldcommerce.com/guides/price-rules/resources/query-pagination
      parameters:
        - schema:
            type: string
          in: query
          name: external_ids
          description: A list of ruleset external IDs that can be used as a query filter.
        - schema:
            type: string
          in: query
          name: product_ids
          description: A list of product IDs that can be used as a query filter.
        - schema:
            type: string
          in: query
          name: variant_ids
          description: A list of product IDs or Variant IDs can be used combined as a query filter.
        - schema:
            type: string
          in: query
          name: skus
          description: A list of product SKUs can be used as a query filter.
        - schema:
            type: string
          in: query
          name: fields
          description: List of the ruleset fields to be returned; if this parameter is empty, all the available fields will be included in the response.
        - schema:
            type: string
          in: query
          name: page
          description: Page number, considering that the results could span for several pages. Default is 1.
        - schema:
            type: string
          in: query
          name: limit
          description: Page size, considering that the results could span for several pages. Default is 50.
        - schema:
            type: boolean
          in: query
          name: include_all_apps
          description: The standard behaviour for this endpoint is to return just the rulesets that were created using the same auth token. To see all rulesets instead, this parameter should be set to true.
        - schema:
            type: string
          in: query
          name: filter_expression
          description: 'This endpoint supports extra query columns to filter the rulesets. To use this parameter you should use like this: filter_expression:operation(column:value).'
    parameters:
      - schema:
          type: string
        name: shop_identifier
        in: path
        required: true
        description: Bold platform identifier for the shop. Find this identifier using the [Get Shop Info](shops#operation/GetShopInfo) endpoint.
  /price_rules/rules/v2/shops/{shop_identifier}/rulesets/{ruleset_id}:
    get:
      summary: Get Ruleset by ID
      operationId: GetRulesetByID
      tags:
        - Rulesets
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  data:
                    type: object
                    required:
                      - ruleset
                    properties:
                      ruleset:
                        $ref: '#/components/schemas/Ruleset'
                required:
                  - message
                  - data
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                401-error-example:
                  value:
                    message: This request failed to be authenticated.
                    code: 00-1
                    type: authentication.failed
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                403-error-example:
                  value:
                    message: This request does not contain the necessary permissions to access the target endpoint.
                    code: 00-2
                    type: authorization.invalid_scopes
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                404-error-example:
                  value:
                    message: No rulesets found for provided parameters.
                    code: 04-9
                    type: price_rules.ruleset_not_found
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      description: Return data for a specific ruleset, selected by the ruleset database ID. This requires read_price_rulesets scope/permission.
    parameters:
      - schema:
          type: string
        name: shop_identifier
        in: path
        required: true
        description: Bold platform identifier for the shop. Find this identifier using the [Get Shop Info](shops#operation/GetShopInfo) endpoint.
      - schema:
          type: string
        name: ruleset_id
        in: path
        required: true
        description: Ruleset database ID.
    put:
      summary: Update Ruleset by ID
      operationId: UpdateRulesetByID
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      ruleset:
                        $ref: '#/components/schemas/Ruleset'
              examples:
                200-response-example:
                  value:
                    message: Successfully updated ruleset
                    data:
                      ruleset:
                        id: 84
                        external_id: CreatedByAPI_1
                        active: true
                        internal_name: This ruleset was created by the API and now it is being changed
                        public_name: ''
                        start_date: null
                        expiry_date: null
                        sync_percent: 0
                        priority: 0
                        created_at: '2020-05-08T14:42:56Z'
                        updated_at: '2020-05-08T14:43:14Z'
                        rules:
                          - type: DISCOUNT
                            conditions:
                              - type: CUSTOMER_GROUP
                                value: silver
                              - type: QTY_BY_PRODUCT
                                operator: '>='
                                value: 3
                            actions:
                              - type: PRICE_ADJUST_PERCENT
                                value: -8
                              - type: CHARM_PRICE
                                value: 99
                        product_selection:
                          product_ids:
                            - '1234567890123'
                            - '1234567890987'
                          type: SHOPIFY_PRODUCT_SEARCH
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                401-error-example:
                  value:
                    message: This request failed to be authenticated.
                    code: 00-1
                    type: authentication.failed
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                403-error-example:
                  value:
                    message: This request does not contain the necessary permissions to access the target endpoint.
                    code: 00-2
                    type: authorization.invalid_scopes
      description: Change attributes for an existent ruleset, selected by the ruleset database ID. This requires write_price_rulesets scope/permission.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                ruleset:
                  $ref: '#/components/schemas/BasicRuleset'
            examples:
              update-ruleset-example:
                value:
                  ruleset:
                    external_id: CreatedByAPI_1
                    internal_name: This ruleset was created by the API and now it is being changed
                    product_selection:
                      type: SHOPIFY_PRODUCT_SEARCH
                      product_ids:
                        - '1234567890123'
                        - '1234567890987'
                    rules:
                      - type: DISCOUNT
                        conditions:
                          - type: CUSTOMER_GROUP
                            value: silver
                          - type: QTY_BY_PRODUCT
                            operator: '>='
                            value: 3
                        actions:
                          - type: PRICE_ADJUST_PERCENT
                            value: -8
                          - type: CHARM_PRICE
                            value: 99
      tags:
        - Rulesets
    delete:
      summary: Delete Ruleset by ID
      operationId: DeleteRulesetByID
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                401-error-example:
                  value:
                    message: This request failed to be authenticated.
                    code: 00-1
                    type: authentication.failed
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                403-error-example:
                  value:
                    message: This request does not contain the necessary permissions to access the target endpoint.
                    code: 00-2
                    type: authorization.invalid_scopes
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      description: Delete a ruleset, selected by the ruleset database ID. This requires write_price_rulesets scope/permission.
      tags:
        - Rulesets
    patch:
      summary: Patch Ruleset by ID
      operationId: PatchRulesetByID
      responses:
        '204':
          description: Successfully updated ruleset
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                401-error-example:
                  value:
                    message: This request failed to be authenticated.
                    code: 00-1
                    type: authentication.failed
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                403-error-example:
                  value:
                    message: This request does not contain the necessary permissions to access the target endpoint.
                    code: 00-2
                    type: authorization.invalid_scopes
      description: Change ruleset attributes including specified rules for an existing ruleset with the specified ruleset database ID without replacing unaffected rules. This requires write_price_rulesets scope/permission.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BasicPatchRuleset'
            examples:
              patch-ruleset-example:
                value:
                  ruleset:
                    start_date: '2020-11-01T00:00:00Z'
                    expiry_date: '2020-11-17T23:59:59Z'
                    rules:
                      - external_id: CreatedByAPI_1
                        type: DISCOUNT
                        conditions:
                          - type: CUSTOMER_GROUP
                            value: silver
                          - type: QTY_BY_PRODUCT
                            operator: '>='
                            value: 3
                        actions:
                          - type: PRICE_ADJUST_PERCENT
                            value: -8
        description: ''
      tags:
        - Rulesets
  /price_rules/rules/v2/shops/{shop_identifier}/rulesets/eid/{external_id}:
    get:
      summary: Get Ruleset by External ID
      operationId: GetRulesetByExternalID
      tags:
        - Rulesets
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      ruleset:
                        $ref: '#/components/schemas/Ruleset'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                401-error-example:
                  value:
                    message: This request failed to be authenticated.
                    code: 00-1
                    type: authentication.failed
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                403-error-example:
                  value:
                    message: This request does not contain the necessary permissions to access the target endpoint.
                    code: 00-2
                    type: authorization.invalid_scopes
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      description: Return data for a specific ruleset, selected by the ruleset external ID. This requires read_price_rulesets scope/permission.
    parameters:
      - schema:
          type: string
        name: shop_identifier
        in: path
        required: true
        description: Bold platform identifier for the shop. Find this identifier using the [Get Shop Info](shops#operation/GetShopInfo) endpoint.
      - schema:
          type: string
        name: external_id
        in: path
        required: true
        description: Ruleset external_id.
      - schema:
          type: boolean
        name: include_all_apps
        in: query
        description: Indicates whether to include rulesets created by other apps. Without this flag (`?include_all_apps=true`), only rulesets created via the Price Rules API are returned.
    post:
      summary: Create Ruleset by External ID
      operationId: CreateRulesetByExternalID
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      ruleset:
                        $ref: '#/components/schemas/Ruleset'
              examples:
                200-response-example:
                  value:
                    message: Successfully updated ruleset
                    data:
                      ruleset:
                        id: 83
                        external_id: CreatedByAPI_12
                        active: true
                        internal_name: This was created by the API using the CreatedByAPI_12 ID
                        public_name: ''
                        start_date: null
                        expiry_date: null
                        sync_percent: 0
                        priority: 0
                        created_at: '2020-05-07T11:05:23Z'
                        updated_at: '2020-05-07T11:05:23Z'
                        rules:
                          - type: DISCOUNT
                            conditions:
                              - type: CUSTOMER_GROUP
                                value: wholesale
                            actions:
                              - type: PRICE_ADJUST_PERCENT
                                value: 1250
                        product_selection:
                          product_ids:
                            - '1234567890123'
                            - '1234567890987'
                          type: SHOPIFY_PRODUCT_SEARCH
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      ruleset:
                        $ref: '#/components/schemas/Ruleset'
              examples:
                201-response-example:
                  value:
                    message: Successfully created ruleset
                    data:
                      ruleset:
                        id: 83
                        external_id: CreatedByAPI_12
                        active: true
                        internal_name: This was created by the API using the CreatedByAPI_12 ID
                        public_name: ''
                        start_date: null
                        expiry_date: null
                        sync_percent: 0
                        priority: 0
                        created_at: '2020-05-07T11:05:23Z'
                        updated_at: '2020-05-07T11:05:23Z'
                        rules:
                          - type: DISCOUNT
                            conditions:
                              - type: CUSTOMER_GROUP
                                value: gold
                            actions:
                              - type: PRICE_ADJUST_ABSOLUTE
                                value: 1500
                        product_selection:
                          product_ids:
                            - '1234567890123'
                            - '1234567890987'
                          type: SHOPIFY_PRODUCT_SEARCH
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                401-error-example:
                  value:
                    message: This request failed to be authenticated.
                    code: 00-1
                    type: authentication.failed
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                403-error-example:
                  value:
                    message: This request does not contain the necessary permissions to access the target endpoint.
                    code: 00-2
                    type: authorization.invalid_scopes
        '422':
          description: Unprocessable Entity (WebDAV)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                422-error-response:
                  value:
                    message: Invalid ruleset in payload
                    code: 04-3
                    type: price_rules.invalid_payload
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                500-error-example:
                  value:
                    message: Error writing ruleset by external_id
                    code: 04-0
                    type: unexpected
      description: This operation has two purposes. If the given ruleset external ID already exists in the database, the ruleset will be updated using the request body information. Otherwise, a new ruleset will be created with the same data. This requires write_price_rulesets scope/permission.
      tags:
        - Rulesets
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                ruleset:
                  $ref: '#/components/schemas/BasicRuleset'
            examples:
              write-ruleset-eid-example:
                value:
                  ruleset:
                    external_id: CreatedByAPI_3
                    internal_name: This ruleset will be created if it still does not exist
                    product_selection:
                      type: SHOPIFY_PRODUCT_SEARCH
                      product_ids:
                        - '1234567890123'
                        - '1234567890987'
                    rules:
                      - type: DISCOUNT
                        conditions:
                          - type: QTY_BY_PRODUCT
                            operator: '>='
                            value: 3
                        actions:
                          - type: PRICE_ADJUST_PERCENT
                            value: -20
                          - type: CHARM_PRICE
                            value: 99
    delete:
      summary: Delete Ruleset by External ID
      operationId: DeleteRulesetByExternalID
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                401-error-example:
                  value:
                    message: This request failed to be authenticated.
                    code: 00-1
                    type: authentication.failed
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                403-error-example:
                  value:
                    message: This request does not contain the necessary permissions to access the target endpoint.
                    code: 00-2
                    type: authorization.invalid_scopes
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                500-error-example:
                  value:
                    message: Error with deleting a ruleset with external_id
                    code: 04-0
                    type: unexpected
      tags:
        - Rulesets
      description: Removes a specific ruleset, selected by the ruleset external ID. This requires write_price_rulesets scope/permission.
    patch:
      summary: Patch Ruleset by External ID
      operationId: PatchRulesetByExternalID
      responses:
        '204':
          description: Successfully updated ruleset
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                401-error-example:
                  value:
                    message: This request failed to be authenticated.
                    code: 00-1
                    type: authentication.failed
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                403-error-example:
                  value:
                    message: This request does not contain the necessary permissions to access the target endpoint.
                    code: 00-2
                    type: authorization.invalid_scopes
      description: Change ruleset attributes including specified rules for an existing ruleset with the specified ruleset external ID without replacing unaffected rules. This requires write_price_rulesets scope/permission.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BasicPatchRuleset'
            examples:
              patch-ruleset-example:
                value:
                  ruleset:
                    start_date: '2020-11-01T00:00:00Z'
                    expiry_date: '2020-11-17T23:59:59Z'
                    rules:
                      - external_id: CreatedByAPI_1
                        type: DISCOUNT
                        conditions:
                          - type: CUSTOMER_GROUP
                            value: silver
                          - type: QTY_BY_PRODUCT
                            operator: '>='
                            value: 3
                        actions:
                          - type: PRICE_ADJUST_PERCENT
                            value: -8
      tags:
        - Rulesets
  /price_rules/rules/v2/shops/{shop_identifier}/rulesets/bulk/activate:
    parameters:
      - schema:
          type: string
        name: shop_identifier
        in: path
        required: true
        description: Bold platform identifier for the shop. Find this identifier using the [Get Shop Info](shops#operation/GetShopInfo) endpoint.
    post:
      summary: Activate All Rulesets
      operationId: ActivateAllRulesets
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  data:
                    type: array
                    items: {}
              examples:
                200-response-example:
                  value:
                    message: Successfully activated 22 rulesets
                    data: []
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                401-error-example:
                  value:
                    message: This request failed to be authenticated.
                    code: 00-1
                    type: authentication.failed
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                403-error-example:
                  value:
                    message: This request does not contain the necessary permissions to access the target endpoint.
                    code: 00-2
                    type: authorization.invalid_scopes
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                500-error-example:
                  value:
                    message: Error while activating rulesets
                    code: 04-0
                    type: unexpected
      description: Set the status of all rulesets to active in the specified shop. This requires write_price_rulesets scope/permission.
      tags:
        - Rulesets
  /price_rules/rules/v2/shops/{shop_identifier}/rulesets/bulk/deactivate:
    parameters:
      - schema:
          type: string
        name: shop_identifier
        in: path
        required: true
        description: Bold platform identifier for the shop. Find this identifier using the [Get Shop Info](shops#operation/GetShopInfo) endpoint.
    post:
      summary: Deactivate All Rulesets
      operationId: DeactivateAllRulesets
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  data:
                    type: array
                    items: {}
              examples:
                200-response-example:
                  value:
                    message: Successfully deactivated 18 rulesets
                    data: []
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                401-error-example:
                  value:
                    message: This request failed to be authenticated.
                    code: 00-1
                    type: authentication.failed
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                403-error-example:
                  value:
                    message: This request does not contain the necessary permissions to access the target endpoint.
                    code: 00-2
                    type: authorization.invalid_scopes
      description: Set the status of all rulesets to inactive in the specified shop. This requires write_price_rulesets scope/permission.
      tags:
        - Rulesets
  /price_rules/storefront/v2/shops/{shop_identifier}/rulesets:
    parameters:
      - schema:
          type: string
        name: shop_identifier
        in: path
        required: true
        description: Bold platform identifier for the shop. Find this identifier using the [Get Shop Info](shops#operation/GetShopInfo) endpoint.
    get:
      summary: List Rulesets by Product ID
      operationId: ListRulesetsByProductID
      tags:
        - Rulesets
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      rulesets:
                        type: array
                        description: Each set of rules that is related to the shop and the given products.
                        items:
                          $ref: '#/components/schemas/Ruleset'
                      shop_options:
                        $ref: '#/components/schemas/ShopOptions'
                      base_prices:
                        type: array
                        items:
                          $ref: '#/components/schemas/BasePrice'
              examples:
                200-response-example:
                  value:
                    message: Successfully fetched rulesets
                    data:
                      rulesets:
                        - id: 56
                          app_slug: my-cool-app
                          public_name: ''
                          internal_name: ''
                          external_id: ''
                          active: true
                          sync_percent: 100
                          priority: 100
                          expiry_date: null
                          rules:
                            - type: DISCOUNT
                              conditions:
                                - type: CUSTOMER_GROUP
                                  value: wholesale
                              actions:
                                - type: PRICE_ADJUST_RELATIVE
                                  value: -5000
                            - type: DISCOUNT
                              conditions:
                                - type: CUSTOMER_GROUP
                                  value: gold
                              actions:
                                - type: PRICE_ADJUST_RELATIVE
                                  value: -2500
                            - type: DISCOUNT
                              conditions:
                                - type: CUSTOMER_GROUP
                                  value: silver
                              actions:
                                - type: PRICE_ADJUST_RELATIVE
                                  value: -1250
                            - type: DISCOUNT
                              conditions:
                                - type: CUSTOMER_GROUP
                                  value: bronze
                              actions:
                                - type: PRICE_ADJUST_RELATIVE
                                  value: -620
                          product_selection:
                            type: SHOPIFY_PRODUCT_SEARCH
                            products:
                              - product_id: '1234567890123'
                      shop_options:
                        compare_at_price_as_original: true
                        verbose_logs: true
                        include_base_prices: true
                      base_prices:
                        - id: 98765432101234
                          price: 10000
                        - id: 98765432109876
                          price: 12000
      description: List all rulesets available for the specified shop and product IDs.  This requires no special permissions.
      parameters:
        - schema:
            type: string
          in: query
          name: products
          description: 'A comma separated list of all product IDs; Example: ?products=123'
          required: true
        - schema:
            type: string
          in: query
          name: filter[]
          description: 'Rule condition filter. Example: &filter[]=eq(CUSTOMER_GROUP%3Agold)&filter[]=like(CURRENCY%3ACAD)'
  /price_rules/rules/v2/hello-api:
    get:
      summary: Simple Communication Test
      operationId: SimpleCommunicationTest
      tags:
        - Simple Communication Test
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: The success message.
                  data:
                    type: object
                    properties:
                      hello:
                        type: string
                        description: A simple Hello World.
              examples:
                test-response-example:
                  value:
                    message: Successfully reached Price Rules API
                    data:
                      hello: world!
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      description: Test endpoint to ensure that the request contains a valid token and that it is successfully reaching Price Rules API. This requires no special permissions.
  /price_rules/rules/v2/shops/{shop_identifier}/order_condition:
    parameters:
      - schema:
          type: string
        name: shop_identifier
        in: path
        required: true
        description: Bold platform identifier for the shop. Find this identifier using the [Get Shop Info](shops#operation/GetShopInfo) endpoint.
    get:
      summary: List Order Conditions
      operationId: ListOrderConditions
      tags:
        - Order Conditions
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      order_conditions:
                        type: array
                        items:
                          $ref: '#/components/schemas/OrderCondition'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
              examples:
                200-response-example:
                  value:
                    message: Successfully fetched order conditions
                    data:
                      order_conditions:
                        - name: ZONE
                          value: north-america-04
                          operator: ONE_OF
                          type: FIELD_SET
                          field_sets:
                            - field_set_id: 27
                              customer.shipping.country: Canada
                              customer.shipping.postal_code: R3Y0L6
                            - field_set_id: 28
                              customer.shipping.country: Canada
                              customer.shipping.postal_code: R3T5Y3
                            - field_set_id: 66
                              customer.shipping.country: Canada
                              customer.shipping.postal_code: R3T345
                        - name: ZONE
                          value: north-america-05
                          operator: ONE_OF
                          type: FIELD_SET
                          field_sets:
                            - field_set_id: 71
                              customer.shipping.country: United States of America
                              customer.shipping.postal_code: R3Y0L6
                            - field_set_id: 72
                              customer.shipping.country: United States of America
                              customer.shipping.postal_code: R3T5Y3
                    pagination:
                      total: 2
                      count: 2
                      per_page: 50
                      current_page: 1
                      total_pages: 1
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      parameters:
        - schema:
            type: string
          in: query
          name: deep
          description: If this flag is true, all the details of the Order Condition will be included in the response. Otherwise, only basic information (name, value, etc.) will be returned.
        - schema:
            type: integer
          in: query
          name: page
          description: The desired page number for the paginated result (default is 1).
        - schema:
            type: integer
          in: query
          name: limit
          description: Size of the page to be used for the paginated result (default is 50).
      description: List all Order Conditions available for the specified shop. Requires the read_price_order_conditions scope/permission.
    post:
      summary: Create Order Condition
      operationId: CreateOrderCondition
      tags:
        - Order Conditions
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  data:
                    type: object
                    required:
                      - order_condition
                    properties:
                      order_condition:
                        type: object
                        items:
                          $ref: '#/components/schemas/OrderCondition'
                required:
                  - message
                  - data
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '413':
          description: Request Entity Too Large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable Entity (WebDAV)
        '500':
          description: Internal Server Error
      description: Creates an Order Condition. Requires the write_price_order_conditions scope/permission.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderCondition'
            examples:
              create-order-condition-example:
                value:
                  name: zone
                  value: north-america-05
                  operator: ONE_OF
                  type: FIELD_SET
                  field_sets:
                    - customer.shipping.postal_code: '90210'
                      customer.shipping.country_code: US
                    - customer.shipping.postal_code: '55555'
                      customer.shipping.country_code: US
  /price_rules/rules/v2/shops/{shop_identifier}/order_condition/condition_name/{condition_name}/condition_value/{condition_value}:
    parameters:
      - schema:
          type: string
        name: shop_identifier
        in: path
        required: true
        description: Bold platform identifier for the shop. Find this identifier using the [Get Shop Info](shops#operation/GetShopInfo) endpoint.
      - schema:
          type: string
        name: condition_name
        in: path
        required: true
        description: Name of the condition. This can be used to group similar options that depend on the same piece of data. For example, it is possible to have several Order Conditions with the same name (DELIVERY_ZONE) and different values (NorthAmerica, Europe) that evaluate the same fields (country, city and postal code).
      - schema:
          type: string
        name: condition_value
        in: path
        required: true
        description: Value of the condition. This describes an option available for a collection of conditions that share the same name. Discounts will be applied based on the presence of a specific "name:value" pair. It is possible to have several Order Conditions with identical names (DELIVERY_ZONE) and different values/options (NorthAmerica, Europe) as long as they evaluate the same fields (country, city and postal code).
    get:
      summary: Get Order Condition
      operationId: GetOrderCondition
      tags:
        - Order Conditions
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      order_condition:
                        $ref: '#/components/schemas/OrderCondition'
              examples:
                200-response-example:
                  value:
                    message: Successfully fetched order condition
                    data:
                      order_condition:
                        name: ZONE
                        value: Prairies
                        operator: ONE_OF
                        type: FIELD_SET
                        field_sets:
                          - field_set_id: 71
                            customer.shipping.country: Canada
                            customer.shipping.postal_code: R3Y0L6
                          - field_set_id: 72
                            customer.shipping.country: Canada
                            customer.shipping.postal_code: R3T5Y3
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      description: Gets an Order Condition by its name and value. Requires the read_price_order_conditions scope/permission.
    delete:
      summary: Delete Order Condition by Name and Value
      operationId: DeleteOrderConditionByNameAndValue
      tags:
        - Order Conditions
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      description: Delete an Order Condition by condition_name and condition_value. Requires the write_price_order_conditions scope/permission.
    put:
      summary: Update Order Condition
      operationId: UpdateOrderCondition
      tags:
        - Order Conditions
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      order_condition:
                        $ref: '#/components/schemas/OrderCondition'
              examples:
                200-response-example:
                  value:
                    message: Successfully updated order condition
                    data:
                      order_condition:
                        name: ZONE
                        value: north-america-01
                        operator: ONE_OF
                        type: FIELD_SET
                        field_sets:
                          - field_set_id: 82
                            customer.shipping.country: United States of America
                            customer.shipping.postal_code: '91210'
                          - field_set_id: 83
                            customer.shipping.country: United States of America
                            customer.shipping.postal_code: '99999'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '413':
          description: Request Entity Too Large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable Entity (WebDAV)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      description: Updates an Order Condition. Requires the write_price_order_conditions scope/permission.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderCondition'
            examples:
              update-order-condition-example:
                value:
                  name: ZONE
                  value: north-america-01
                  operator: ONE_OF
                  type: FIELD_SET
                  field_sets:
                    - field_set_id: 3
                      customer.shipping.country: United States of America
                      customer.shipping.postal_code: '91210'
                    - customer.shipping.country: United States of America
                      customer.shipping.postal_code: '99999'
  /price_rules/rules/v2/shops/{shop_identifier}/order_condition/valid_fields:
    parameters:
      - schema:
          type: string
        name: shop_identifier
        in: path
        required: true
        description: Bold platform identifier for the shop. Find this identifier using the [Get Shop Info](shops#operation/GetShopInfo) endpoint.
    get:
      summary: List Valid Fields for Order Condition
      operationId: ListValidFieldsForOrderCondition
      tags:
        - Order Conditions
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      field_names:
                        type: array
                        items:
                          type: string
              examples:
                200-response-example:
                  value:
                    message: Successfully fetched valid field names
                    data:
                      field_names:
                        - customer.shipping.country
                        - customer.shipping.country_code
                        - customer.shipping.postal_code
                        - customer.shipping.province
                        - customer.shipping.province_code
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      description: Gets a list of all the shop/customer fields that can be evaluated in an Order Condition. Requires the read_price_order_conditions scope/permission.
  /price_rules/rules/v2/shops/{shop_identifier}/order_condition/condition_name/{condition_name}:
    parameters:
      - schema:
          type: string
        name: shop_identifier
        in: path
        required: true
        description: Bold platform identifier for the shop. Find this identifier using the [Get Shop Info](shops#operation/GetShopInfo) endpoint.
      - schema:
          type: string
        name: condition_name
        in: path
        required: true
        description: The name and value of an Order Condition are a combination that uniquely identifies that condition.
    delete:
      summary: Delete Order Condition by Name
      operationId: DeleteOrderConditionByName
      tags:
        - Order Conditions
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      description: Delete a collection of Order Conditions that share the same name, for example all the DELIVERY_ZONE Order Conditions regardless of their values (NorthAmerica, Europe, etc.). Requires the write_price_order_conditions scope/permission.
      parameters:
        - schema:
            type: string
          in: query
          name: condition_name
          description: Name of the condition.
          required: true
  /price_rules/rules/v2/shops/{shop_identifier}/order_condition/condition_name/{condition_name}/field_name/{field_name}:
    parameters:
      - schema:
          type: string
        name: shop_identifier
        in: path
        required: true
        description: Bold platform identifier for the shop. Find this identifier using the [Get Shop Info](shops#operation/GetShopInfo) endpoint.
      - schema:
          type: string
        name: condition_name
        in: path
        required: true
        description: The name and value of an Order Condition are a combination that uniquely identifies that condition.
      - schema:
          type: string
        name: field_name
        in: path
        required: true
        description: Field that should be deleted, for example "customer.shipping.province".
    delete:
      summary: Delete Order Condition Field by Name
      operationId: DeleteOrderConditionFieldByName
      tags:
        - Order Conditions
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      description: Delete a field from all the Order Conditions that share the same name. For example, if a list of DELIVERY_ZONE conditions were evaluating both city and postal code before, and now they should check the postal code only, then the irrelevant field (city) can be erased by this operation. Requires the write_price_order_conditions scope/permission.
  /price_rules/rules/v2/shops/{shop_identifier}/order_condition/field_sets/add:
    parameters:
      - schema:
          type: string
        name: shop_identifier
        in: path
        required: true
        description: Bold platform identifier for the shop. Find this identifier using the [Get Shop Info](shops#operation/GetShopInfo) endpoint.
    patch:
      summary: Add Field Sets to Order Condition
      operationId: AddFieldSetsToOrderCondition
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      order_condition:
                        $ref: '#/components/schemas/OrderCondition'
                      field_sets_added:
                        type: array
                        description: This operation returns only the Field Sets that were added, not the complete list.
                        items:
                          $ref: '#/components/schemas/FieldSet'
              examples:
                200-response-example:
                  value:
                    message: Successfully added field set(s) to order condition
                    data:
                      order_condition:
                        name: ZONE
                        value: Prairies
                        operator: ONE_OF
                        type: FIELD_SET
                      field_sets_added:
                        - field_set_id: 76
                          customer.shipping.country: United States of America
                          customer.shipping.postal_code: '98765'
                        - field_set_id: 77
                          customer.shipping.country: United States of America
                          customer.shipping.postal_code: '43210'
                        - field_set_id: 78
                          customer.shipping.country: United States of America
                          customer.shipping.postal_code: '88888'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      description: Adds one or more new Field Sets to a specific Order Condition. Requires the write_price_order_conditions scope/permission.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: The name and value of an Order Condition are a combination that uniquely identifies that condition.
                value:
                  type: string
                  description: The name and value of an Order Condition are a combination that uniquely identifies that condition.
                field_sets:
                  type: array
                  description: Field sets to be added.
                  items:
                    $ref: '#/components/schemas/FieldSet'
            examples:
              add-fieldsets-example:
                value:
                  name: ZONE
                  value: north-america-05
                  field_sets:
                    - customer.shipping.country: United States of America
                      customer.shipping.postal_code: '98765'
                    - customer.shipping.country: United States of America
                      customer.shipping.postal_code: '43210'
                    - customer.shipping.country: United States of America
                      customer.shipping.postal_code: '88888'
      tags:
        - Order Conditions
  /price_rules/rules/v2/shops/{shop_identifier}/order_condition/field_sets/remove:
    parameters:
      - schema:
          type: string
        name: shop_identifier
        in: path
        required: true
        description: Bold platform identifier for the shop. Find this identifier using the [Get Shop Info](shops#operation/GetShopInfo) endpoint.
    patch:
      summary: Delete Field Sets from Order Condition
      operationId: DeleteFieldSetsFromOrderCondition
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      order_condition:
                        type: object
                        properties:
                          name:
                            type: string
                            description: The name and value of an Order Condition are a combination that uniquely identifies that condition.
                          value:
                            type: string
                            description: The name and value of an Order Condition are a combination that uniquely identifies that condition.
                          '':
                            type: string
              examples:
                200-response-example:
                  value:
                    message: Successfully removed 3 field set(s) from order condition
                    data:
                      order_condition:
                        name: ZONE
                        value: north-america-05
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      description: Remove one or more existent Field Sets from a specific Order Condition. Requires the write_price_order_conditions scope/permission.
      tags:
        - Order Conditions
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: The name and value of an Order Condition are a combination that uniquely identifies that condition.
                value:
                  type: string
                  description: The name and value of an Order Condition are a combination that uniquely identifies that condition.
                field_set_ids:
                  type: array
                  description: List containing the ids of each Field Set that should be removed.
                  items: {}
            examples:
              remove-field-sets-example:
                value:
                  name: ZONE
                  value: north-america-05
                  field_set_ids:
                    - 69
                    - 70
                    - 73
  /price_rules/rules/v2/shops/{shop_identifier}/order_condition/condition_name/{condition_name}/condition_value/{condition_value}/field_sets:
    parameters:
      - schema:
          type: string
        name: shop_identifier
        in: path
        required: true
        description: Bold platform identifier for the shop. Find this identifier using the [Get Shop Info](shops#operation/GetShopInfo) endpoint.
      - schema:
          type: string
        name: condition_name
        in: path
        required: true
        description: Name of the condition. This can be used to group similar options that depend on the same piece of data. For example, it is possible to have several Order Conditions with the same name (DELIVERY_ZONE) and different values (NorthAmerica, Europe) that evaluate the same fields (country, city and postal code).
      - schema:
          type: string
        name: condition_value
        in: path
        required: true
        description: Value of the condition. This describes an option available for a collection of conditions that share the same name. Discounts will be applied based on the presence of a specific "name:value" pair. It is possible to have several Order Conditions with the identical names (DELIVERY_ZONE) and different values/options (NorthAmerica, Europe) as long as they evaluate the same fields (country, city and postal code).
    get:
      summary: List Matching Field Sets for Order Condition
      operationId: ListMatchingFieldSetsForOrderCondition
      tags:
        - Order Conditions
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      field_sets:
                        type: array
                        items:
                          $ref: '#/components/schemas/FieldSet'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
              examples:
                200-response-example:
                  value:
                    message: Successfully fetched matched field sets for order condition
                    data:
                      field_sets:
                        - field_set_id: 71
                          customer.shipping.country: United States of America
                          customer.shipping.postal_code: R3Y0L6
                        - field_set_id: 72
                          customer.shipping.country: United States of America
                          customer.shipping.postal_code: R3T5Y3
                    pagination:
                      total: 2
                      count: 2
                      per_page: 50
                      current_page: 1
                      total_pages: 1
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      description: 'Gets all the sets of fields that are valid/that comply with an Order Condition. An Order Condition can be matched by different sets of data, for example ''DELIVERY_ZONE: NorthAmerica'' could include a lot of possible country + postal code combinations. Requires the read_price_order_conditions scope/permission.'
      parameters:
        - schema:
            type: string
          in: query
          name: page
          description: The desired page number for the paginated result (default is 1).
        - schema:
            type: string
          in: query
          name: limit
          description: Size of the page to be used for the paginated result (default is 50).
  /price_rules/rules/v2/shops/{shop_identifier}/order_condition/condition_name/{condition_name}/validate:
    parameters:
      - schema:
          type: string
        name: shop_identifier
        in: path
        required: true
        description: Bold platform identifier for the shop. Find this identifier using the [Get Shop Info](shops#operation/GetShopInfo) endpoint.
      - schema:
          type: string
        name: condition_name
        in: path
        required: true
        description: Name of the condition. This can be used to group similar options that depend on the same piece of data. For example, it is possible to have several Order Conditions with the same name (DELIVERY_ZONE) and different values (NorthAmerica, Europe) that evaluate the same fields (country, city and postal code).
    get:
      summary: Validate Order Condition Group
      operationId: ValidateOrderConditionGroup
      tags:
        - Order Conditions
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: The message contains the result of the Order Condition group analysis
                  data:
                    type: array
                    description: Data for this operation will be always empty
                    items:
                      type: object
              examples:
                200-response-example:
                  value:
                    message: 'Order condition ''ZONE: North-America-05'' has one or more field sets that are missing field(s). Order condition ''ZONE: North-America-10'' has one or more field sets that contain unexpected fields. Order condition ''ZONE: Europe-07'' has one or more field sets that are missing field(s). Expected fields for the ''ZONE'' group are: [customer.shipping.country, customer.shipping.postal_code]'
                    data: []
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      description: |-
        This endpoint can be used to check internal inconsistencies between an Order Condition group (a set of conditions that share the same condition_name). All Order Conditions that share a name should evaluate the same fields.

        For example: If a shop has a condition "name: zone, value: north-america-05" that contains several combinations of country and postal code on its field sets, when a new condition "name: zone, value: europe-01" is created on the same shop it should also use country and postal code to define its field sets.

        Requires the read_price_order_conditions scope/permission.
  /price_rules/rules/v2/shops/{shop_identifier}/process:
    parameters:
      - schema:
          type: string
        name: shop_identifier
        in: path
        required: true
        description: Bold platform identifier for the shop. Find this identifier using the [Get Shop Info](shops#operation/GetShopInfo) endpoint.
    post:
      summary: Get Adjusted Cart
      operationId: GetAdjustedCart
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  pre_checkout_id:
                    type: string
                  actions:
                    type: array
                    items:
                      $ref: '#/components/schemas/CartAction'
              examples:
                example adjusted cart response:
                  value:
                    pre_checkout_id: POS_123
                    actions:
                      - key: uniquekey1
                        price: 10
                        matchValue: '123'
                        quantity: 2
                        rule:
                          - id: 1
                            rule_set_id: 1
                            rule_set_eid: ruleset_eid
                      - key: uniquekey2
                        price: 12
                        matchValue: '223'
                        quantity: 1
                        rule:
                          - id: 1
                            rule_set_id: 1
                            rule_set_eid: ruleset_eid
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                401-error-example:
                  value:
                    message: This request failed to be authenticated.
                    code: 00-1
                    type: authentication.failed
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                403-error-example:
                  value:
                    message: This request does not contain the necessary permissions to access the target endpoint.
                    code: 00-2
                    type: authorization.invalid_scopes
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                500-error-example:
                  value:
                    message: Error with fetching a ruleset
                    code: 04-0
                    type: unexpected
      description: Return final price for lineItem in a cart. This requires read_price_rulesets scope/permission.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                lineItems:
                  type: array
                  items:
                    $ref: '#/components/schemas/ProcessLineItem'
                matchLineItemProperty:
                  type: string
                  enum:
                    - sku
                customer:
                  $ref: '#/components/schemas/Customer'
              required:
                - lineItems
                - matchLineItemProperty
            examples:
              example cart payload:
                value:
                  lineItems:
                    - key: uniquekey1
                      price: 12
                      matchValue: '123'
                      quantity: 2
                    - key: uniquekey2
                      price: 15
                      matchValue: '223'
                      quantity: 1
                  matchLineItemProperty: sku
                  customer:
                    shipping:
                      postal_code: R3Y0X5
      tags:
        - Rulesets
  /price_rules/storefront/v2/shops/{shop_identifier}/price:
    parameters:
      - schema:
          type: string
        name: shop_identifier
        in: path
        required: true
        description: Bold platform identifier for the shop. Find this identifier using the [Get Shop Info](shops#operation/GetShopInfo) endpoint.
    post:
      summary: Get Final Price for Product
      operationId: GetFinalPriceForProduct
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  pre_best_price_log_id:
                    type: string
                  actions:
                    type: array
                    items:
                      $ref: '#/components/schemas/BestProductPriceAction'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      description: Return the final price for item. This requires no special permissions.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                items:
                  type: array
                  items:
                    $ref: '#/components/schemas/BestProductPriceItem'
                cart_params:
                  type: object
                  description: Supply optional parameters, such as orderData and source
                lineItemIdType:
                  type: string
                  enum:
                    - sku
                customer:
                  $ref: '#/components/schemas/TaggedCustomer'
              required:
                - items
                - lineItemIdType
            examples:
              example-1:
                value:
                  lineItemIdType: sku
                  items:
                    - price: 0
                      id: number
                      quantity: 0
                  cart_params: {}
                  customer:
                    tags: string
                    shipping:
                      postal_code: string
                      country: string
                      country_code: string
                      province: string
                      province_code: string
        description: ''
      tags:
        - Storefronts
  /price_rules/storefront/v2/currency/{currency_name}:
    parameters:
      - schema:
          type: string
        name: currency_name
        in: path
        required: true
        description: 'Currency Code (ie. USD, CAD, GDP). Can be optained through: https://www.iban.com/currency-codes'
    get:
      summary: Get Currency Symbol for Currency Code
      operationId: GetCurrencySymbolForCurrencyCode
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                description: ''
                type: object
                properties:
                  id:
                    type: number
                  currency_iso_name:
                    type: string
                    minLength: 1
                  friendly_name:
                    type: string
                    minLength: 1
                  currency_symbol:
                    type: string
                    minLength: 1
                  money_format:
                    type: string
                    minLength: 1
                  money_with_currency_format:
                    type: string
                    minLength: 1
                required:
                  - id
                  - currency_iso_name
                  - friendly_name
                  - currency_symbol
                  - money_format
                  - money_with_currency_format
              examples:
                200-response-example:
                  value:
                    id: 181
                    currency_iso_name: CAD
                    friendly_name: Canadian Dollar
                    currency_symbol: $
                    money_format: ${{amount}}
                    money_with_currency_format: ${{amount}} CAD
      description: 'Get Currency information from a currency code (ie. USD, CAD, GDP). Can be obtained through: https://www.iban.com/currency-codes'
      tags:
        - Storefronts
      parameters: []
  /price_rules/storefront/v2/shops/{shop_identifier}/cart:
    parameters:
      - schema:
          type: string
        name: shop_identifier
        in: path
        required: true
        description: Bold platform identifier for the shop. Find this identifier using the [Get Shop Info](shops#operation/GetShopInfo) endpoint.
    post:
      summary: Get Best Price for Cart
      operationId: GetBestPriceForCart
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  pre_checkout_id:
                    type: string
                  actions:
                    type: array
                    items:
                      $ref: '#/components/schemas/CartAction'
              examples:
                example adjusted cart response:
                  value:
                    pre_checkout_id: POS_123
                    actions:
                      - line_item_key: uniquekey1
                        value: 10
                        sku: '123'
                        variant_id: 49702426812601
                        rule:
                          - id: 1593607
                            eid: rule_id
                            rule_set_id: 101480
                            rule_set_eid: ruleset_eid
                            rule_set_public_message: ''
                            type: DISCOUNT
                      - line_item_key: uniquekey2
                        value: 12
                        sku: '223'
                        variant_id: 29702426812602
                        rule:
                          - id: 5593607
                            eid: rule_id_2
                            rule_set_id: 601480
                            rule_set_eid: ruleset_eid_2
                            rule_set_public_message: A public message
                            type: DISCOUNT
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                500-error-example:
                  value:
                    message: Error with fetching a ruleset
                    code: 04-0
                    type: unexpected
      description: Return final price for lineItem in a cart. This requires no special permissions.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                lineItems:
                  type: array
                  items:
                    $ref: '#/components/schemas/LineItem'
                lineItemIdType:
                  type: string
                  enum:
                    - sku
                customer:
                  $ref: '#/components/schemas/TaggedCustomer'
              required:
                - lineItems
                - lineItemIdType
            examples:
              example cart payload:
                value:
                  lineItems:
                    - key: uniquekey1
                      price: 12
                      id: '123'
                      quantity: 2
                    - key: uniquekey2
                      price: 15
                      id: '223'
                      quantity: 1
                  lineItemIdType: sku
                  customer:
                    email: user@example.com
      tags:
        - Storefronts
  /price_rules/rules/v2/shops/{shop_identifier}/rulesets/eid/{external_id}/rules/remove:
    parameters:
      - schema:
          type: string
        name: shop_identifier
        in: path
        required: true
        description: Bold platform identifier for the shop. Find this identifier using the [Get Shop Info](shops#operation/GetShopInfo) endpoint.
      - schema:
          type: string
        name: external_id
        in: path
        required: true
    patch:
      summary: Bulk Delete Rules by Ruleset EID
      operationId: BulkDeleteRulesByRulesetEID
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
              examples:
                sample response:
                  value:
                    message: Successfully removed 2 rules from ruleset with rulesetId:1
      description: Remove one or more existent rules from a specific Ruleset. Requires the write_price_rulesets scope/permission.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                rule_ids:
                  type: array
                  items:
                    type: integer
              required:
                - rule_ids
            examples:
              Payload example:
                value:
                  rule_ids:
                    - 1
                    - 2
        description: ''
      parameters: []
      tags:
        - Rules
  /price_rules/rules/v2/shops/{shop_identifier}/rulesets/{ruleset_id}/rules/remove:
    parameters:
      - schema:
          type: string
        name: shop_identifier
        in: path
        required: true
        description: Bold platform identifier for the shop. Find this identifier using the [Get Shop Info](shops#operation/GetShopInfo) endpoint.
      - schema:
          type: string
        name: ruleset_id
        in: path
        required: true
    patch:
      summary: Bulk Delete Rules by Ruleset ID
      operationId: BulkDeleteRulesByRulesetID
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
              examples:
                sample response:
                  value:
                    message: Successfully removed 2 rules from ruleset with rulesetId:1
      description: Remove one or more existent rules from a specific Ruleset. Requires the write_price_rulesets scope/permission.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                rule_ids:
                  type: array
                  items:
                    type: integer
              required:
                - rule_ids
            examples:
              Payload example:
                value:
                  rule_ids:
                    - 1
                    - 2
        description: ''
      tags:
        - Rules
  /price_rules/rules/v2/shops/{shop_identifier}/discount_codes:
    parameters:
      - schema:
          type: string
        name: shop_identifier
        in: path
        required: true
        description: Bold platform identifier for the shop. Find this identifier using the [Get Shop Info](shops#operation/GetShopInfo) endpoint.
    post:
      summary: Create Discount Code
      operationId: CreateDiscountCode
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: The message contains the result of this operation.
                  data:
                    type: object
                    properties:
                      discount_codes:
                        type: array
                        items:
                          $ref: '#/components/schemas/DiscountCode'
              examples:
                200-response-example:
                  value:
                    message: Discount code(s) created successfully!
                    data:
                      discount_codes:
                        - code: BACK_TO_SCHOOL
                          updated_at: '2020-09-16T20:39:57.000000Z'
                          created_at: '2020-09-16T20:39:57.000000Z'
                          id: 8
                          ruleset:
                            id: '20'
                            external_id: RELATED_TO_DISCOUNT_CODE_BACK_TO_SCHOOL
                            active: true
                            internal_name: RELATED_TO_DISCOUNT_CODE_BACK_TO_SCHOOL
                            created_at: '2020-09-16T15:39:56Z'
                            updated_at: '2020-09-16T15:39:56Z'
                            rules:
                              - type: DISCOUNT_CODE
                                conditions:
                                  - type: DISCOUNT_CODE
                                    value: BACK_TO_SCHOOL
                                actions:
                                  - type: PRICE_ADJUST_PERCENT
                                    value: -10
                            product_selection:
                              product_ids:
                                - '1234567890123'
                                - '1234567890456'
                              type: PRODUCT_SEARCH
                        - code: BLACKFRIDAY
                          updated_at: '2020-09-16T20:39:57.000000Z'
                          created_at: '2020-09-16T20:39:57.000000Z'
                          id: 9
                          ruleset:
                            id: '21'
                            external_id: RELATED_TO_DISCOUNT_CODE_BLACKFRIDAY
                            active: true
                            internal_name: RELATED_TO_DISCOUNT_CODE_BLACKFRIDAY
                            created_at: '2020-09-16T15:39:57Z'
                            updated_at: '2020-09-16T15:39:57Z'
                            rules:
                              - type: DISCOUNT_CODE
                                conditions:
                                  - type: DISCOUNT_CODE
                                    value: BLACKFRIDAY
                                actions:
                                  - type: PRICE_ADJUST_PERCENT
                                    value: -10
                            product_selection:
                              product_ids:
                                - '1234567890123'
                                - '1234567890456'
                              type: PRODUCT_SEARCH
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable Entity (WebDAV)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      description: Create one or more discount codes for the specified shop. This requires write_discount_codes scope/permission. Bold automatically assigns a `DISCOUNT_CODE` rule condition type to every discount code created.
      tags:
        - Discount Codes
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                discount_code:
                  $ref: '#/components/schemas/CreateDiscountCode'
              required:
                - discount_code
            examples:
              body-example:
                value:
                  discount_code:
                    codes:
                      - BACK_TO_SCHOOL
                      - BLACKFRIDAY
                    limits:
                      - limit_type: per_shop
                        limit_amount: 1000
                    product_selection:
                      type: PRODUCT_SEARCH
                      product_ids:
                        - '1234567890123'
                        - '1234567890456'
                    conditions:
                      - type: CART_SUBTOTAL_MIN
                        value: 5000
                    action:
                      type: PRICE_ADJUST_PERCENT
                      value: -10
        description: Initial data needed to configure the new discount code(s).
    get:
      summary: List Discount Codes
      operationId: ListDiscountCodes
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: The message contains the result of this operation.
                  data:
                    type: object
                    properties:
                      discount_codes:
                        type: array
                        items:
                          $ref: '#/components/schemas/DiscountCode'
              examples:
                200-response-example:
                  value:
                    message: Successfully fetched discount codes
                    data:
                      discount_codes:
                        - id: 18
                          code: BLACKFRIDAY
                          created_at: '2020-09-24T13:51:23.000000Z'
                          updated_at: '2020-09-28T15:47:43.000000Z'
                          ruleset:
                            id: '51'
                            external_id: RELATED_TO_DISCOUNT_CODE_BLACKFRIDAY
                            active: true
                            internal_name: RELATED_TO_DISCOUNT_CODE_BLACKFRIDAY
                            created_at: '2020-09-28T10:47:43Z'
                            updated_at: '2020-09-28T15:47:44Z'
                            rules:
                              - type: DISCOUNT_CODE
                                conditions:
                                  - type: DISCOUNT_CODE
                                    value: BLACKFRIDAY
                                actions:
                                  - type: PRICE_ADJUST_PERCENT
                                    value: -10
                            product_selection:
                              product_ids:
                                - '9876543210123'
                                - '9876543210987'
                              type: PRODUCT_SEARCH
                        - id: 20
                          code: SUPER_SALE_2020
                          created_at: '2020-09-28T21:21:37.000000Z'
                          updated_at: '2020-09-28T21:21:37.000000Z'
                          ruleset:
                            id: '52'
                            external_id: RELATED_TO_DISCOUNT_CODE_SUPER_SALE_2020
                            active: true
                            internal_name: RELATED_TO_DISCOUNT_CODE_SUPER_SALE_2020
                            created_at: '2020-09-28T16:21:37Z'
                            updated_at: '2020-09-28T21:21:38Z'
                            rules:
                              - type: DISCOUNT_CODE
                                conditions:
                                  - type: DISCOUNT_CODE
                                    value: SUPER_SALE_2020
                                actions:
                                  - type: PRICE_ADJUST_PERCENT
                                    value: -15
                            product_selection:
                              product_ids:
                                - '1234567890123'
                                - '1234567890987'
                              type: PRODUCT_SEARCH
                        - id: 21
                          code: 1STORDERBONUS
                          created_at: '2020-09-28T21:21:37.000000Z'
                          updated_at: '2020-09-28T21:21:37.000000Z'
                          ruleset:
                            id: '53'
                            external_id: RELATED_TO_DISCOUNT_CODE_1STORDERBONUS
                            active: true
                            internal_name: RELATED_TO_DISCOUNT_CODE_1STORDERBONUS
                            created_at: '2020-09-28T16:21:37Z'
                            updated_at: '2020-09-28T21:21:38Z'
                            rules:
                              - type: DISCOUNT_CODE
                                conditions:
                                  - type: DISCOUNT_CODE
                                    value: 1STORDERBONUS
                                actions:
                                  - type: PRICE_ADJUST_RELATIVE
                                    value: -599
                            product_selection:
                              product_ids:
                                - '9876543210123'
                                - '9876543210987'
                              type: PRODUCT_SEARCH
                    pagination:
                      total: 3
                      count: 3
                      per_page: 50
                      current_page: 1
                      total_pages: 1
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable Entity (WebDAV)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      description: List all discount codes available for the specified shop. Requires the read_discount_codes scope/permission. Bold automatically assigns a `DISCOUNT_CODE` rule condition type to every discount code created.
      tags:
        - Discount Codes
      parameters:
        - schema:
            type: integer
          in: query
          name: page
          description: The desired page number for the paginated result (default is 1).
        - schema:
            type: integer
          in: query
          name: limit
          description: Size of the page to be used for the paginated result (default is 50).
        - schema:
            type: string
            enum:
              - ACTIVE
              - SCHEDULED
              - EXPIRED
          in: query
          name: status
          description: Filter the results based on status
        - schema:
            type: string
          in: query
          name: name
          description: The name of the discount code
  /price_rules/rules/v2/shops/{shop_identifier}/discount_codes/{discount_code_id}:
    parameters:
      - schema:
          type: string
        name: shop_identifier
        in: path
        required: true
        description: Bold platform identifier for the shop. Find this identifier using the [Get Shop Info](shops#operation/GetShopInfo) endpoint.
      - schema:
          type: integer
        name: discount_code_id
        in: path
        required: true
        description: The discount code unique identifier in the database
    put:
      summary: Update Discount Code
      operationId: UpdateDiscountCode
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: The message contains the result of this operation.
                  data:
                    type: object
                    properties:
                      discount_code:
                        $ref: '#/components/schemas/DiscountCode'
              examples:
                200-response-example:
                  value:
                    message: Discount code updated successfully!
                    data:
                      discount_code:
                        id: 15
                        code: SOME_EXISTENT_DISCOUNT_CODE
                        created_at: '2020-09-22T20:39:39.000000Z'
                        updated_at: '2020-09-23T18:54:46.000000Z'
                        ruleset:
                          id: '34'
                          external_id: RELATED_TO_DISCOUNT_CODE_SOME_EXISTENT_DISCOUNT_CODE
                          active: true
                          internal_name: RELATED_TO_DISCOUNT_CODE_SOME_EXISTENT_DISCOUNT_CODE
                          created_at: '2020-09-23T13:54:46Z'
                          updated_at: '2020-09-23T13:54:46Z'
                          rules:
                            - type: DISCOUNT_CODE
                              conditions:
                                - type: DISCOUNT_CODE
                                  value: SOME_EXISTENT_DISCOUNT_CODE
                              actions:
                                - type: PRICE_ADJUST_RELATIVE
                                  value: -15
                          product_selection:
                            product_ids:
                              - '4567890123456'
                              - '4567890987654'
                            type: PRODUCT_SEARCH
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable Entity (WebDAV)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      description: Update an existing discount code available for the specified shop. This requires write_discount_codes scope/permission.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                discount_code:
                  $ref: '#/components/schemas/UpdateDiscountCode'
              required:
                - discount_code
            examples:
              body-example:
                value:
                  discount_code:
                    code: SOME_EXISTENT_DISCOUNT_CODE
                    limit:
                      limit_type: per_customer
                      limit_amount: 5
                    product_selection:
                      type: PRODUCT_SEARCH
                      product_ids:
                        - '4567890123456'
                        - '4567890987654'
                    action:
                      type: PRICE_ADJUST_RELATIVE
                      value: -15
        description: Target values for the discount code after update; all fields should be passed, fields that are not intended to change should contain their current values.
      tags:
        - Discount Codes
    get:
      summary: Get Discount Code by ID
      operationId: GetDiscountCodeByID
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: The message contains the result of this operation.
                  data:
                    type: object
                    properties:
                      discount_code:
                        $ref: '#/components/schemas/DiscountCode'
              examples:
                200-response-example:
                  value:
                    message: Successfully fetched discount code by id
                    data:
                      discount_code:
                        id: 18
                        code: BLACKFRIDAY
                        created_at: '2020-09-24T13:51:23.000000Z'
                        updated_at: '2020-09-25T21:27:14.000000Z'
                        ruleset:
                          id: '50'
                          external_id: RELATED_TO_DISCOUNT_CODE_BLACKFRIDAY
                          active: true
                          internal_name: RELATED_TO_DISCOUNT_CODE_BLACKFRIDAY
                          created_at: '2020-09-25T16:27:13Z'
                          updated_at: '2020-09-25T16:27:13Z'
                          rules:
                            - type: DISCOUNT_CODE
                              conditions:
                                - type: DISCOUNT_CODE
                                  value: BLACKFRIDAY
                              actions:
                                - type: PRICE_ADJUST_PERCENT
                                  value: -10
                          product_selection:
                            product_ids:
                              - '1234567890123'
                              - '1234567890987'
                            type: PRODUCT_SEARCH
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable Entity (WebDAV)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      description: Return data for a specific discount code, selected by the discount code ID. This requires read_discount_codes scope/permission.
      tags:
        - Discount Codes
    delete:
      summary: Delete Discount Code
      operationId: DeleteDiscountCode
      responses:
        '204':
          description: No Content
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      tags:
        - Discount Codes
      description: Remove an existing discount code available for the specified shop. This requires write_discount_codes scope/permission.
  /price_rules/rules/v2/shops/{shop_identifier}/rulesets/{ruleset_id}/discount_codes:
    parameters:
      - schema:
          type: string
        name: shop_identifier
        in: path
        required: true
        description: Bold platform identifier for the shop. Find this identifier using the [Get Shop Info](shops#operation/GetShopInfo) endpoint.
      - schema:
          type: string
        name: ruleset_id
        in: path
        required: true
        description: The database ID for the ruleset that describes the discount code behaviour.
    get:
      summary: Get Discount Code by Ruleset ID
      operationId: GetDiscountCodeByRulesetID
      tags:
        - Discount Codes
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: The message contains the result of this operation.
                  data:
                    type: object
                    properties:
                      discount_code:
                        $ref: '#/components/schemas/DiscountCode'
              examples:
                200-response-example:
                  value:
                    message: Successfully fetched discount code for ruleset
                    data:
                      discount_code:
                        id: 29
                        code: TOP_CLEARANCE_10%
                        created_at: '2020-09-29T20:28:31.000000Z'
                        updated_at: '2020-09-29T20:34:26.000000Z'
                        ruleset:
                          id: '63'
                          external_id: RELATED_TO_DISCOUNT_CODE_TOP_CLEARANCE_10%
                          active: true
                          internal_name: RELATED_TO_DISCOUNT_CODE_TOP_CLEARANCE_10%
                          created_at: '2020-09-29T15:34:26Z'
                          updated_at: '2020-09-29T20:34:27Z'
                          rules:
                            - type: DISCOUNT_CODE
                              conditions:
                                - type: DISCOUNT_CODE
                                  value: TOP_CLEARANCE_10%
                              actions:
                                - type: PRICE_ADJUST_PERCENT
                                  value: -10
                          product_selection:
                            product_ids:
                              - '9998887770123'
                              - '9998887770456'
                              - '9998887770789'
                            type: PRODUCT_SEARCH
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable Entity (WebDAV)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      description: Return data for a specific discount code, selected by the related ruleset ID. This requires read_discount_codes scope/permission.
  /price_rules/rules/v2/shops/{shop_identifier}/rulesets/eid/{external_id}/rules/eid/{rule_external_id}:
    parameters:
      - schema:
          type: string
        name: shop_identifier
        in: path
        required: true
        description: Bold platform identifier for the shop. Find this identifier using the [Get Shop Info](shops#operation/GetShopInfo) endpoint.
      - schema:
          type: string
        name: external_id
        in: path
        required: true
      - schema:
          type: string
        name: rule_external_id
        in: path
        required: true
    put:
      summary: Update Rule by Ruleset EID and Rule EID
      operationId: UpdateRuleByRulesetEIDRuleEID
      tags:
        - Rules
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  data:
                    $ref: '#/components/schemas/RuleResponse'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '409':
          description: Conflict
        '500':
          description: Internal Server Error
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                rule:
                  $ref: '#/components/schemas/Rule'
              required:
                - rule
      description: |-
        Update a Rule by using the Ruleset external_id and Rule external_id.

        Requires the check_write_rulesets_permission scope/permission.
  /price_rules/rules/v2/shops/{shop_identifier}/rulesets/eid/{external_id}/rules/add:
    parameters:
      - schema:
          type: string
        name: external_id
        in: path
        required: true
      - schema:
          type: string
        name: shop_identifier
        in: path
        required: true
        description: Bold platform identifier for the shop. Find this identifier using the [Get Shop Info](shops#operation/GetShopInfo) endpoint.
    patch:
      summary: Bulk Add Rules by Ruleset EID
      operationId: BulkAddRulesByRulesetEID
      tags:
        - Rules
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '409':
          description: Conflict
        '422':
          description: Unprocessable Entity (WebDAV)
        '500':
          description: Internal Server Error
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                rules:
                  type: array
                  items:
                    $ref: '#/components/schemas/Rule'
              required:
                - rules
        description: ''
      description: Bulk add Rules to a Ruleset.
  /price_rules/rules/v2/shops/{shop_identifier}/rulesets/{ruleset_id}/rules/{rule_id}:
    parameters:
      - schema:
          type: string
        name: shop_identifier
        in: path
        required: true
        description: Bold platform identifier for the shop. Find this identifier using the [Get Shop Info](shops#operation/GetShopInfo) endpoint.
      - schema:
          type: string
        name: ruleset_id
        in: path
        required: true
      - schema:
          type: string
        name: rule_id
        in: path
        required: true
    put:
      summary: Update Rule by Ruleset ID and Rule ID
      operationId: UpdateRuleByRulesetIDRuleID
      tags:
        - Rules
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  data:
                    $ref: '#/components/schemas/RuleResponse'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '409':
          description: Conflict
        '500':
          description: Internal Server Error
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                rule:
                  $ref: '#/components/schemas/Rule'
              required:
                - rule
      description: |-
        Update a Rule by using the Ruleset id and Rule id.

        Requires the check_write_rulesets_permission scope/permission.
    delete:
      summary: Remove Rule by Ruleset ID and Rule ID
      operationId: RemoveRuleByRulesetIDRuleID
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                401-error-example:
                  value:
                    code: string
                    message: string
                    type: string
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                403-error-example:
                  value:
                    code: string
                    message: string
                    type: string
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                404-error-example:
                  value:
                    code: string
                    message: string
                    type: string
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      description: Remove one rule from a specific Ruleset. Requires the write_price_rulesets scope/permission.
      tags:
        - Rules
  /price_rules/rules/v2/shops/{shop_identifier}/rulesets/eid/{external_id}/rules/{rule_id}:
    parameters:
      - schema:
          type: string
        name: shop_identifier
        in: path
        required: true
        description: Bold platform identifier for the shop. Find this identifier using the [Get Shop Info](shops#operation/GetShopInfo) endpoint.
      - schema:
          type: string
        name: external_id
        in: path
        required: true
      - schema:
          type: string
        name: rule_id
        in: path
        required: true
    put:
      summary: Update Rule by Ruleset EID and Rule ID
      operationId: UpdateRuleByRulesetEIDRuleID
      tags:
        - Rules
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  data:
                    $ref: '#/components/schemas/RuleResponse'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '409':
          description: Conflict
        '500':
          description: Internal Server Error
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                rule:
                  $ref: '#/components/schemas/Rule'
              required:
                - rule
      description: |-
        Update a Rule by using the Ruleset external_id and Rule id.

        Requires the check_write_rulesets_permission scope/permission.
    delete:
      summary: Delete Rule from Ruleset by Ruleset EID and Rule ID
      operationId: DeleteRuleFromRulesetByRulesetEIDRuleID
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                example-1:
                  value:
                    code: string
                    message: string
                    type: string
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      description: Remove one rule from a specific Ruleset. Requires the write_price_rulesets scope/permission.
      tags:
        - Rules
  /price_rules/rules/v2/shops/{shop_identifier}/rulesets/{ruleset_id}/rules/eid/{rule_external_id}:
    parameters:
      - schema:
          type: string
        name: shop_identifier
        in: path
        required: true
        description: Bold platform identifier for the shop. Find this identifier using the [Get Shop Info](shops#operation/GetShopInfo) endpoint.
      - schema:
          type: string
        name: ruleset_id
        in: path
        required: true
      - schema:
          type: string
        name: rule_external_id
        in: path
        required: true
    put:
      summary: Update Rule by Ruleset ID and Rule EID
      operationId: UpdateRuleByRulesetIDRuleEID
      tags:
        - Rules
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  data:
                    $ref: '#/components/schemas/RuleResponse'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '409':
          description: Conflict
        '500':
          description: Internal Server Error
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                rule:
                  $ref: '#/components/schemas/Rule'
              required:
                - rule
      description: |-
        Update a Rule by using the Ruleset id and Rule external_id.

        Requires the check_write_rulesets_permission scope/permission.
  /price_rules/rules/v2/shops/{shop_identifier}/rulesets/{ruleset_id}/rules/add:
    parameters:
      - schema:
          type: string
        name: shop_identifier
        in: path
        required: true
        description: Bold platform identifier for the shop. Find this identifier using the [Get Shop Info](shops#operation/GetShopInfo) endpoint.
      - schema:
          type: string
        name: ruleset_id
        in: path
        required: true
    patch:
      summary: Bulk Add Rules by Ruleset ID
      operationId: BulkAddRulesByRulesetID
      tags:
        - Rules
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '409':
          description: Conflict
        '422':
          description: Unprocessable Entity (WebDAV)
        '500':
          description: Internal Server Error
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                rules:
                  type: array
                  minItems: 1
                  items:
                    $ref: '#/components/schemas/Rule'
              required:
                - rules
        description: ''
      description: Bulk add Rules to a Ruleset.
  /price_rules/rules/v2/shops/{shop_identifier}/rulesets/{ruleset_id}/rules:
    parameters:
      - schema:
          type: string
        name: shop_identifier
        in: path
        required: true
        description: Bold platform identifier for the shop. Find this identifier using the [Get Shop Info](shops#operation/GetShopInfo) endpoint.
      - schema:
          type: string
        name: ruleset_id
        in: path
        required: true
    get:
      summary: List Rules by Ruleset ID
      operationId: ListRulesByRulesetID
      tags:
        - Rules
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  data:
                    type: object
                    items:
                      $ref: '#/components/schemas/RuleResponse'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
              examples:
                200-response-example:
                  value:
                    message: Successfully fetched rules
                    data:
                      - id: number
                        external_id: string
                        conditions:
                          - value: 5
                            type: QTY_BY_LINE
                            operator: '='
                            requiresPrepare: true
                        actions:
                          - value: 99
                            type: PRICE_ADJUST_ABSOLUTE
                    pagination:
                      total: 2
                      count: 2
                      per_page: 50
                      current_page: 1
                      total_pages: 1
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                404-error-example:
                  value:
                    code: string
                    message: 'Error with fetching rules with ruleset with id: 1234567'
                    type: string
      description: Returns all rules in a ruleset in a paginated format.
      parameters:
        - schema:
            type: string
          in: query
          name: page
          description: Page number, considering that the results could span for several pages. Default is 1.
        - schema:
            type: string
          in: query
          name: limit
          description: Page size, considering that the results could span for several pages. Default is 50.
  /price_rules/rules/v2/shops/{shop_identifier}/rulesets/eid/{external_id}/rules:
    parameters:
      - schema:
          type: string
        name: shop_identifier
        in: path
        required: true
        description: Bold platform identifier for the shop. Find this identifier using the [Get Shop Info](shops#operation/GetShopInfo) endpoint.
      - schema:
          type: string
        name: external_id
        in: path
        required: true
    get:
      summary: List Rules by Ruleset External ID
      operationId: ListRulesByRulesetExternalID
      tags:
        - Rules
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  data:
                    type: object
                    items:
                      $ref: '#/components/schemas/RuleResponse'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
      description: Returns all rules in a ruleset in a paginated format.
      parameters:
        - schema:
            type: string
          in: query
          name: page
          description: Page number, considering that the results could span for several pages. Default is 1.
        - schema:
            type: string
          in: query
          name: limit
          description: Page size, considering that the results could span for several pages. Default is 50.
  /price_rules/rules/v2/shops/{shop_identifier}/discount_codes/{discount_code_id}/activate:
    parameters:
      - schema:
          type: string
        name: shop_identifier
        in: path
        required: true
        description: Bold platform identifier for the shop. Find this identifier using the [Get Shop Info](shops#operation/GetShopInfo) endpoint.
      - schema:
          type: string
        name: discount_code_id
        in: path
        required: true
    patch:
      summary: Activate Discount Code
      operationId: ActivateDiscountCode
      tags:
        - Discount Codes
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: The message contains the result of this operation.
                  data:
                    type: object
                    properties:
                      discount_code:
                        $ref: '#/components/schemas/DiscountCode'
              examples:
                200-response-example:
                  value:
                    message: Successfully activated discount code
                    data:
                      discount_code:
                        id: 197
                        code: efijo
                        created_at: '2021-02-03T16:11:07.000000Z'
                        updated_at: '2021-02-05T16:32:46.000000Z'
                        ruleset:
                          id: '272'
                          external_id: RELATED_TO_DISCOUNT_CODE_efijo
                          shop_id: 9
                          app_slug: pdc-shopify
                          active: true
                          internal_name: RELATED_TO_DISCOUNT_CODE_efijo
                          public_name: ''
                          rule_set_data: '{"rules":[{"type":"DISCOUNT_CODE","conditions":[{"type":"DISCOUNT_CODE","value":"efijo"}],"actions":[{"type":"PRICE_ADJUST_PERCENT","value":50}]}]}'
                          start_date: '2021-02-03T16:11:07.000000Z'
                          expiry_date: '2021-02-03T16:11:07.000000Z'
                          sync_percent: 100
                          priority: 0
                          selection_type: 1
                          selection_data: '{"product_ids":["5809048617123","5809050615971"]}'
                          created_at: '2021-02-03T16:11:07.000000Z'
                          updated_at: '2021-02-03T16:11:07.000000Z'
                        limits: []
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable Entity (WebDAV)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      description: Updates the `start_date` to be `now()`, and will update the `expiry_date` if it is in the past. Returns the data for the updated discount code. This requires write_discount_codes scope/permission.
  /price_rules/rules/v2/shops/{shop_identifier}/discount_codes/{discount_code_id}/deactivate:
    parameters:
      - schema:
          type: string
        name: shop_identifier
        in: path
        required: true
        description: Bold platform identifier for the shop. Find this identifier using the [Get Shop Info](shops#operation/GetShopInfo) endpoint.
      - schema:
          type: string
        name: discount_code_id
        in: path
        required: true
    patch:
      summary: Deactivate Discount Code
      operationId: DeactivateDiscountCode
      tags:
        - Discount Codes
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: The message contains the result of this operation.
                  data:
                    type: object
                    properties:
                      discount_code:
                        $ref: '#/components/schemas/DiscountCode'
              examples:
                200-response-example:
                  value:
                    message: Successfully deactivated discount code
                    data:
                      discount_code:
                        id: 197
                        code: efijo
                        created_at: '2021-02-03T16:11:07.000000Z'
                        updated_at: '2021-02-05T16:32:46.000000Z'
                        ruleset:
                          id: '272'
                          external_id: RELATED_TO_DISCOUNT_CODE_efijo
                          shop_id: 9
                          app_slug: pdc-shopify
                          active: true
                          internal_name: RELATED_TO_DISCOUNT_CODE_efijo
                          public_name: ''
                          rule_set_data: '{"rules":[{"type":"DISCOUNT_CODE","conditions":[{"type":"DISCOUNT_CODE","value":"efijo"}],"actions":[{"type":"PRICE_ADJUST_PERCENT","value":50}]}]}'
                          start_date: '2021-02-03T16:11:07.000000Z'
                          expiry_date: '2021-02-03T16:11:07.000000Z'
                          sync_percent: 100
                          priority: 0
                          selection_type: 1
                          selection_data: '{"product_ids":["5809048617123","5809050615971"]}'
                          created_at: '2021-02-03T16:11:07.000000Z'
                          updated_at: '2021-02-03T16:11:07.000000Z'
                        limits: []
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable Entity (WebDAV)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      description: Updates the `expiry_date` to be `now()`. Returns the data for the updated discount code. This requires write_discount_codes scope/permission.
  /price_rules/storefront/v2/shops/{shop_domain}/order_condition:
    parameters:
      - schema:
          type: string
        name: shop_domain
        in: path
        required: true
    post:
      summary: List Eligible Order Conditions for Shop
      operationId: ListEligibleOrderConditionsForShop
      tags:
        - Order Conditions
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    enum:
                      - Successfully applied order condition to shop
                  data:
                    type: object
                    properties:
                      order_condition:
                        type: array
                        description: array of order condition key value pair
                        items: {}
              examples:
                example-1:
                  value:
                    message: Successfully applied order condition to shop
                    data:
                      order_condition:
                        location: Vancouver
      description: Tests order conditions against shop and customer data, and returns the condition names and values that match. Requires no special permissions/scopes.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                customer:
                  $ref: '#/components/schemas/OrderConditionCustomerSchema'
            examples:
              example-1:
                value:
                  customer:
                    shipping:
                      postal_code: string
                      country: string
                      country_code: string
                      province: string
                      province_code: string
components:
  securitySchemes:
    OAuthToken:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://apps.boldapps.net/accounts/dashboard/authorize
          tokenUrl: https://api.boldcommerce.com/auth/oauth2/token
          scopes: {}
      description: Authenticates an API request from a [public integration](/guides/price-rules/resources/glossary#public-integration). Generate this token in the [Developer Dashboard](https://developer-dashboard.boldcommerce.com/default/dashboard). Refer to [Build Public Integrations](/guides/checkout/public-integrations) for more information.
    APIAccessToken:
      type: apiKey
      name: API Access Token
      in: header
      description: Authenticates an API request from a [private integration](/guides/price-rules/resources/glossary#private-integration). Generate this token in the [Bold Account Center](https://account.boldcommerce.com/). Refer to [Making API Calls](/guides/checkout/quick-start) for more information.
  schemas:
    Ruleset:
      title: Ruleset
      type: object
      description: A set of rules that can apply to a defined group of products, depending on the rule conditions being met. This more complete type refers to all the fields that can be obtained when getting one or more rulesets.
      properties:
        id:
          description: Ruleset database ID.
          type: integer
        product_selection:
          type: object
          description: IDs, vendors or product titles used to filter where the ruleset applies, along with the specific platform filter type.
          properties:
            titles:
              type: array
              description: List of all product titles that might be affected by the ruleset.
              items:
                type: string
            collection_ids:
              type: array
              description: List of platform collection IDs that might be affected by the ruleset.
              items:
                type: string
            variant_ids:
              type: array
              description: List of platform variant IDs that might be affected by the ruleset.
              items:
                type: string
            product_ids:
              type: array
              description: List of platform product IDs that might be affected by the ruleset.
              items:
                type: string
            vendors:
              type: array
              description: List of all vendors whose products might be affected by the ruleset.
              items:
                type: string
            product_types:
              type: string
            sku_ids:
              type: array
              description: List of all SKUs that might be affected by the ruleset.
              items:
                type: string
            type:
              type: string
              enum:
                - SHOPIFY_PRODUCT_SEARCH
                - SHOPIFY_PRODUCTS_ALL
                - PRODUCT_SEARCH
                - PRODUCTS_ALL
        rules:
          type: array
          description: Each one of the rules contained in this ruleset.
          items:
            $ref: '#/components/schemas/Rule'
        updated_at:
          type: string
          description: If the ruleset was altered, this will be the most recent date in which any changes occurred.
          format: date-time
          nullable: true
        created_at:
          type: string
          description: Ruleset creation date.
          format: date-time
        priority:
          type: number
          description: Defines the priority of this ruleset above other rulesets that belong to the same app.
        sync_percent:
          type: integer
          minimum: 0
          maximum: 100
          description: Described the current percentage of the process that synchronizes this ruleset with the shop. Should be set to zero when the rule is created/altered.
        expiry_date:
          type: string
          description: Date from which the ruleset will stop being effective.
          format: date-time
          nullable: true
        start_date:
          type: string
          description: Date from which the ruleset should be considered effective.
          format: date-time
          nullable: true
        public_name:
          type: string
          description: A public facing name for the ruleset.
        internal_name:
          type: string
          description: If the ruleset was created by an external app, this is the app name for the ruleset.
        active:
          type: boolean
          description: Indicates if this ruleset is currently active.
        external_id:
          type: string
          description: If the ruleset was created by an external app, the external_id will be set as the app identifier for the ruleset.
        app_slug:
          type: string
          description: Name or identifier of the app that owns the ruleset. For private operations this is ommited, since the app is implicit (and it is directly related to the auth token).
      required:
        - rules
        - active
    Rule:
      type: object
      title: Rule
      description: 'Comprised by one or more actions that can alter the price or the storefront in general, and a set of zero or more conditions that must be met for the rule to be applied. '
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - DISCOUNT
            - DISCOUNT_CODE
            - DISCOUNTABLE_ADDITION
            - ADDITION
            - STACKABLE_DISCOUNT
            - ROUNDING
            - DISPLAY
            - SETTING
            - BUNDLE
            - REF_URL
            - LINE_ITEM_PROPERTY
            - CUSTOMER_PROVINCE
            - CUSTOMER_GROUP
            - QTY_BY_MIX_AND_MATCH
            - QTY_BY_PRODUCT
            - QTY_BY_VARIANT
            - QTY_BY_LINE
            - SUBSCRIPTION_GROUP
            - SUBSCRIPTION_INTERVAL
          description: The rule type defines how the rule is applied in parallel with other rules, and also how it should behave.
        conditions:
          type: array
          description: One or more conditions that need to be matched for the rule to apply.
          items:
            anyOf:
              - $ref: '#/components/schemas/ConditionBuyXGetYDiscountCode'
              - $ref: '#/components/schemas/ConditionCartSubtotalMin'
              - $ref: '#/components/schemas/ConditionCurrency'
              - $ref: '#/components/schemas/ConditionCustomerCountry'
              - $ref: '#/components/schemas/ConditionCustomerGroup'
              - $ref: '#/components/schemas/ConditionCustomerId'
              - $ref: '#/components/schemas/ConditionCustomerInAnyGroupFromList'
              - $ref: '#/components/schemas/ConditionCustomerProvince'
              - $ref: '#/components/schemas/ConditionLineItemProperty'
              - $ref: '#/components/schemas/ConditionQtyByBundle'
              - $ref: '#/components/schemas/ConditionQtyByLine'
              - $ref: '#/components/schemas/ConditionQtyByMixAndMatch'
              - $ref: '#/components/schemas/ConditionQtyByProduct'
              - $ref: '#/components/schemas/ConditionQtyByVariant'
              - $ref: '#/components/schemas/ConditionQtyOnCart'
              - $ref: '#/components/schemas/ConditionRefUrl'
              - $ref: '#/components/schemas/ConditionShippingRateRange'
              - $ref: '#/components/schemas/ConditionSubscriptionGroup'
              - $ref: '#/components/schemas/ConditionSubscriptionInterval'
              - $ref: '#/components/schemas/ConditionCurrency'
              - $ref: '#/components/schemas/ConditionOrderCondition'
              - $ref: '#/components/schemas/ConditionCartSubtotalMin'
            discriminator:
              propertyName: type
              mapping:
                BUY_X_GET_Y_DISCOUNT_CODE: '#/components/schemas/ConditionBuyXGetYDiscountCode'
                CART_SUBTOTAL_MIN: '#/components/schemas/ConditionCartSubtotalMin'
                CURRENCY: '#/components/schemas/ConditionCurrency'
                CUSTOMER_COUNTRY: '#/components/schemas/ConditionCustomerCountry'
                CUSTOMER_GROUP: '#/components/schemas/ConditionCustomerGroup'
                CUSTOMER_ID: '#/components/schemas/ConditionCustomerId'
                CUSTOMER_IN_ANY_GROUP_FROM_LIST: '#/components/schemas/ConditionCustomerInAnyGroupFromList'
                CUSTOMER_PROVINCE: '#/components/schemas/ConditionCustomerProvince'
                LINE_ITEM_PROPERTY: '#/components/schemas/ConditionLineItemProperty'
                BUNDLE: '#/components/schemas/ConditionQtyByBundle'
                QTY_BY_LINE: '#/components/schemas/ConditionQtyByLine'
                QTY_BY_MIX_AND_MATCH: '#/components/schemas/ConditionQtyByMixAndMatch'
                QTY_BY_PRODUCT: '#/components/schemas/ConditionQtyByProduct'
                QTY_BY_VARIANT: '#/components/schemas/ConditionQtyByVariant'
                QTY_ON_CART: '#/components/schemas/ConditionQtyOnCart'
                REF_URL: '#/components/schemas/ConditionRefUrl'
                SHIPPING_RATE_RANGE: '#/components/schemas/ConditionShippingRateRange'
                SUBSCRIPTION_GROUP: '#/components/schemas/ConditionSubscriptionGroup'
                SUBSCRIPTION_INTERVAL: '#/components/schemas/ConditionSubscriptionInterval'
        actions:
          type: array
          minItems: 1
          items:
            anyOf:
              - $ref: '#/components/schemas/ActionPriceAdjustAbsolute'
              - $ref: '#/components/schemas/ActionPriceAdjustRelative'
              - $ref: '#/components/schemas/ActionPriceAdjustPercent'
              - $ref: '#/components/schemas/ActionPriceAdjustAbsoluteWithLimit'
              - $ref: '#/components/schemas/ActionPriceAdjustRelativeWithLimit'
              - $ref: '#/components/schemas/ActionCharmPrice'
              - $ref: '#/components/schemas/ActionAdjustRate'
              - $ref: '#/components/schemas/ActionAddFee'
              - $ref: '#/components/schemas/ActionDisplayQtyBreak'
              - $ref: '#/components/schemas/ActionCustomerDraftOrderTaxable'
              - $ref: '#/components/schemas/ActionPriceAdjustAbsoluteBasePrice'
            discriminator:
              propertyName: type
              mapping:
                PRICE_ADJUST_ABSOLUTE: '#/components/schemas/ActionPriceAdjustAbsolute'
                PRICE_ADJUST_RELATIVE: '#/components/schemas/ActionPriceAdjustRelative'
                PRICE_ADJUST_PERCENT: '#/components/schemas/ActionPriceAdjustPercent'
                PRICE_ADJUST_ABSOLUTE_WITH_LIMIT: '#/components/schemas/ActionPriceAdjustAbsoluteWithLimit'
                PRICE_ADJUST_RELATIVE_WITH_LIMIT: '#/components/schemas/ActionPriceAdjustRelativeWithLimit'
                PRICE_ADJUST_ABSOLUTE_BASE_PRICE: '#/components/schemas/ActionPriceAdjustAbsoluteBasePrice'
                CHARM_PRICE: '#/components/schemas/ActionCharmPrice'
                PRICE_ADJUST_RATE: '#/components/schemas/ActionAdjustRate'
                ADD_FEE: '#/components/schemas/ActionAddFee'
                DISPLAY_QTY_BREAK: '#/components/schemas/ActionDisplayQtyBreak'
                CUSTOMER_DRAFT_ORDER_TAXABLE: '#/components/schemas/ActionCustomerDraftOrderTaxable'
        meta:
          type: object
        external_id:
          type: string
        priority:
          type: number
          description: Defines the priority of a Rule, 0 is default and highest
        stack_order:
          type: number
        id:
          type: number
      required:
        - type
    ActionPriceAdjustAbsolute:
      type: object
      additionalProperties: false
      properties:
        value:
          type: integer
          example: 99
        type:
          type: string
          enum:
            - PRICE_ADJUST_ABSOLUTE
      required:
        - value
        - type
    ActionPriceAdjustRelative:
      type: object
      additionalProperties: false
      properties:
        value:
          type: integer
          example: 299
        type:
          type: string
          enum:
            - PRICE_ADJUST_RELATIVE
      required:
        - value
        - type
    ActionPriceAdjustPercent:
      type: object
      additionalProperties: false
      properties:
        value:
          type: number
          example: 299
        type:
          type: string
          enum:
            - PRICE_ADJUST_PERCENT
      required:
        - value
        - type
    ActionPriceAdjustAbsoluteWithLimit:
      type: object
      additionalProperties: false
      properties:
        value:
          type: integer
          example: 299
        type:
          type: string
          enum:
            - PRICE_ADJUST_ABSOLUTE_WITH_LIMIT
        limit:
          type: integer
          default: 1
        limit_scope:
          type: string
          enum:
            - product
            - variant
            - lineitem
          default: variant
      required:
        - value
        - type
      title: ''
    ActionPriceAdjustRelativeWithLimit:
      type: object
      additionalProperties: false
      properties:
        value:
          type: integer
          example: 299
        type:
          type: string
          enum:
            - PRICE_ADJUST_RELATIVE_WITH_LIMIT
        limit:
          type: integer
        limit_scope:
          type: string
          enum:
            - product
            - variant
            - lineitem
          default: variant
      required:
        - value
        - type
    ActionCharmPrice:
      type: object
      additionalProperties: false
      properties:
        value:
          type: integer
          example: 99
        type:
          type: string
          enum:
            - CHARM_PRICE
      required:
        - value
        - type
    ActionAddFee:
      type: object
      additionalProperties: false
      properties:
        value:
          type: integer
          example: 299
        type:
          type: string
          enum:
            - ADD_FEE
        province:
          type: string
          enum:
            - NL
            - PE
            - NS
            - NB
            - QC
            - QN
            - MB
            - SK
            - AB
            - BC
            - YT
            - NT
            - NU
          description: This functionality is not supported.
        display_inline:
          type: boolean
          description: This functionality is not supported.
        name:
          type: string
      required:
        - value
        - type
    BestProductPriceItem:
      title: BestProductPriceItem
      type: object
      properties:
        price:
          type: integer
        id:
          type: string
        quantity:
          type: integer
    ActionDisplayQtyBreak:
      type: object
      minProperties: 3
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - DISPLAY_QTY_BREAK
        qty:
          type: integer
        percent:
          type: integer
          minimum: 0
          maximum: 100
          example: 15
        price:
          type: integer
        saved:
          type: integer
          default: 0
          example: 299
      required:
        - type
    ActionCustomerDraftOrderTaxable:
      type: object
      additionalProperties: false
      properties:
        value:
          type: boolean
          example: true
        type:
          type: string
          enum:
            - CUSTOMER_DRAFT_ORDER_TAXABLE
      required:
        - value
        - type
    ConditionOrderCondition:
      type: object
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - ORDER_CONDITION
        name:
          type: string
          example: order_condition_by_country
        value:
          type: string
          example: order_condition_canada
      required:
        - type
        - name
        - value
    ConditionQtyByLine:
      type: object
      additionalProperties: false
      properties:
        value:
          type: integer
          example: 5
        type:
          type: string
          enum:
            - QTY_BY_LINE
        operator:
          type: string
          default: '='
          enum:
            - '='
            - '!='
            - <
            - '>'
            - <=
            - '>='
          example: '='
        requiresPrepare:
          type: boolean
          example: true
      required:
        - value
        - type
        - operator
    ConditionQtyByVariant:
      type: object
      additionalProperties: false
      properties:
        value:
          type: integer
          example: 5
        type:
          type: string
          enum:
            - QTY_BY_VARIANT
        operator:
          type: string
          default: '='
          enum:
            - '='
            - '!='
            - <
            - '>'
            - <=
            - '>='
          example: '='
        requiresPrepare:
          type: boolean
          example: true
      required:
        - value
        - type
        - operator
    ConditionQtyByProduct:
      type: object
      additionalProperties: false
      properties:
        value:
          type: integer
          example: 5
        type:
          type: string
          enum:
            - QTY_BY_PRODUCT
        operator:
          default: '='
          type: string
          enum:
            - '='
            - '!='
            - <
            - '>'
            - <=
            - '>='
          example: '='
          description: ''
        requiresPrepare:
          type: boolean
          example: true
      required:
        - value
        - type
        - operator
    ConditionQtyByMixAndMatch:
      type: object
      additionalProperties: false
      properties:
        value:
          type: integer
          example: 5
        type:
          type: string
          enum:
            - QTY_BY_MIX_AND_MATCH
        operator:
          type: string
          default: '='
          enum:
            - '='
            - '!='
            - <
            - '>'
            - <=
            - '>='
          example: '='
        label:
          type: string
          example: sample
      required:
        - value
        - type
        - operator
        - label
    ConditionCustomerGroup:
      type: object
      additionalProperties: false
      properties:
        value:
          type: string
          example: wholesale
        type:
          type: string
          enum:
            - CUSTOMER_GROUP
      required:
        - value
        - type
    ConditionSubscriptionGroup:
      type: object
      additionalProperties: false
      properties:
        value:
          type: number
          example: 123
        type:
          type: string
          enum:
            - SUBSCRIPTION_GROUP
      required:
        - value
        - type
    ConditionSubscriptionInterval:
      type: object
      additionalProperties: false
      properties:
        value:
          type: number
          example: 6
        type:
          type: string
          enum:
            - SUBSCRIPTION_INTERVAL
      required:
        - value
        - type
    ConditionCustomerProvince:
      type: object
      additionalProperties: false
      properties:
        value:
          type: string
          example: manitoba
        type:
          type: string
          enum:
            - CUSTOMER_PROVINCE
      required:
        - value
        - type
    ConditionLineItemProperty:
      type: object
      additionalProperties: false
      properties:
        value:
          type: integer
          example: 49
        type:
          type: string
          enum:
            - LINE_ITEM_PROPERTY
        name:
          type: string
          example: price_rules
        operator:
          type: string
          default: '='
          enum:
            - '='
            - '!='
            - <
            - '>'
            - <=
            - '>='
          example: '='
      required:
        - value
        - type
        - name
        - operator
    ConditionRefUrl:
      type: object
      additionalProperties: false
      properties:
        value:
          type: string
          example: https://store.myshopify.com
        type:
          type: string
          enum:
            - REF_URL
      required:
        - value
        - type
    ConditionQtyByBundle:
      type: object
      additionalProperties: false
      properties:
        value:
          type: object
          additionalProperties:
            type: integer
        type:
          type: string
          enum:
            - BUNDLE
        operator:
          type: string
          default: '='
          enum:
            - '='
            - '!='
            - <
            - '>'
            - <=
            - '>='
          example: '='
        name:
          type: string
          example: price_rules
        values:
          type: array
          items: {}
      required:
        - value
        - type
        - operator
        - name
        - values
    Error:
      title: Error
      type: object
      properties:
        code:
          type: string
          description: Unique identifier for this error
        message:
          type: string
          description: Error details
        type:
          type: string
          description: Error category
      required:
        - code
        - message
      description: Extra information that is returned in case of an HTTP error.
    BasicRuleset:
      title: BasicRuleset
      type: object
      description: A set of rules that can apply to a defined group of products, depending on the rule conditions being met. The basic ruleset type refers to the fields that should be passed when creating or updating a ruleset.
      properties:
        external_id:
          type: string
          description: If the ruleset was created by an external app, the external_id will be set as the app identifier for the ruleset.
        internal_name:
          type: string
          description: If the ruleset was created by an external app, this is the app name for the ruleset.
        start_date:
          type: string
          description: Date from which the ruleset should be considered effective.
          format: date-time
          nullable: true
        expiry_date:
          type: string
          description: Date from which the ruleset will stop being effective.
          format: date-time
          nullable: true
        priority:
          type: number
          description: Defines the priority of this ruleset above other rulesets that belong to the same app.
        rules:
          type: array
          description: Each one of the rules contained in this ruleset.
          items:
            $ref: '#/components/schemas/Rule'
        product_selection:
          type: object
          description: IDs, vendors or product titles used to filter where the ruleset applies, along with the specific platform filter type.
          properties:
            titles:
              type: array
              description: List of all product titles that might be affected by the ruleset.
              items:
                type: string
            collection_ids:
              type: array
              description: List of platform collection IDs that might be affected by the ruleset.
              items:
                type: string
            variant_ids:
              type: array
              description: List of platform variant IDs that might be affected by the ruleset.
              items:
                type: string
            product_ids:
              type: array
              description: List of platform product IDs that might be affected by the ruleset.
              items:
                type: string
            vendors:
              type: array
              description: List of all vendors whose products might be affected by the ruleset.
              items:
                type: string
            product_types:
              type: string
            sku_ids:
              type: string
            type:
              type: string
              enum:
                - SHOPIFY_PRODUCT_SEARCH
                - SHOPIFY_PRODUCTS_ALL
                - PRODUCT_SEARCH
                - PRODUCTS_ALL
    Pagination:
      title: Pagination
      type: object
      properties:
        total:
          type: integer
          description: How many results are available in the database.
        count:
          type: integer
          description: How many results were brought by this search.
        per_page:
          type: integer
          description: Amount of results per page.
        current_page:
          type: integer
          description: If the results span several pages, this contains the current page number.
        total_pages:
          type: integer
          description: How many pages are needed to present all the results in the database.
      description: This object describes basic pagination info, and it is used associated with search results that can span for several pages.
    ShopOptions:
      title: ShopOptions
      type: object
      properties:
        compare_at_price_as_original:
          type: boolean
        verbose_logs:
          type: boolean
        include_base_prices:
          type: boolean
      description: Specific configurations related to the shop that can affect how information is presented or how rules are processed.
    BasePrice:
      title: BasePrice
      type: object
      properties:
        id:
          type: number
          description: The variant ID to which the price applies.
        price:
          type: number
          description: The original or unaltered price of the variant.
      description: Basic price information for variants, before any discounts were applied.
    OrderCondition:
      title: Order Condition
      type: object
      description: An Order Condition can be used to group shopping experiences under specific categories, and then use those categories to apply price changes. For example, the shipping address used by each customer could place it in a collection of DELIVERY_ZONE conditions, with different possible values that would define different discounts.
      properties:
        name:
          type: string
          description: The name of the Order Condition.
        value:
          type: string
          description: The value of the Order Condition.
        operator:
          $ref: '#/components/schemas/Operator'
        type:
          type: string
          description: 'Specifies the `type` the `operator` must match with for this condition. Eg. "operator: ''ONE_OF''", "type:''FIELD_SET`" means that this condition applies if one field_set matches.'
        field_sets:
          type: array
          description: 'All the different combinations of fields and values that match the Order Condition. For example, all the sets of country + city + postal code that are included in the ''DELIVERY_ZONE: NorthAmerica'' condition.'
          items:
            $ref: '#/components/schemas/FieldSet'
      required:
        - name
        - value
        - operator
        - type
    Operator:
      title: Operator
      type: string
      description: Defines the relationship of the Order Condition. Eg 'ONE_OF'.
    FieldSet:
      title: FieldSet
      type: object
      description: 'A FieldSet is a combination of fields and values that match for a specific Order Condition. For example, a set of values for country + city + postal code that match the ''DELIVERY_ZONE: NorthAmerica'' condition.'
      x-examples:
        example-1:
          name: ZONE
          value: Prairies
          operator: ONE_OF
          type: FIELD_SET
          field_sets:
            - field_set_id: 9
              customer.shipping.country: Canada
              customer.shipping.postal_code: R3Y0L6
            - field_set_id: 10
              customer.shipping.country: Canada
              customer.shipping.postal_code: R3T5Y3
      properties:
        field_set_id:
          type: number
          description: The ID of the FieldSet.
        customer.shipping.country:
          type: string
          description: Eg. "Canada".
        customer.shipping.country_code:
          type: string
          description: Eg "CA".
        customer.shipping.postal_code:
          type: string
          description: Eg. "R3Y0L6".
        customer.shipping.province:
          type: string
          description: Eg "Manitoba".
        customer.shipping.province_code:
          type: string
          description: Eg. "MB".
    CreateDiscountCode:
      title: CreateDiscountCode
      type: object
      additionalProperties: false
      description: Payload to create one or more discount codes from scratch.
      properties:
        codes:
          type: array
          description: List of discount code names that should be created sharing this same configuration.
          items:
            type: string
        conditions:
          type: array
          description: Extra requirements for the discount code to be considered eligible. This is an optional field.
          items:
            anyOf:
              - $ref: '#/components/schemas/ConditionCartSubtotalMin'
              - $ref: '#/components/schemas/ConditionShippingRateRange'
              - $ref: '#/components/schemas/ConditionQtyOnCart'
              - $ref: '#/components/schemas/ConditionCustomerInAnyGroupFromList'
              - $ref: '#/components/schemas/ConditionCustomerCountry'
              - $ref: '#/components/schemas/ConditionBuyXGetYDiscountCode'
        action:
          oneOf:
            - $ref: '#/components/schemas/ActionPriceAdjustRelative'
            - $ref: '#/components/schemas/ActionPriceAdjustPercent'
            - $ref: '#/components/schemas/ActionFreeShipping'
            - $ref: '#/components/schemas/ActionShippingAdjustRelative'
            - $ref: '#/components/schemas/ActionShippingAdjustPercent'
            - $ref: '#/components/schemas/ActionCartAdjustRelative'
            - $ref: '#/components/schemas/ActionCartAdjustPercent'
        product_selection:
          oneOf:
            - $ref: '#/components/schemas/DiscountCodeProductSelection'
            - $ref: '#/components/schemas/DiscountCodeVariantSelection'
            - $ref: '#/components/schemas/DiscountCodeAllSelection'
            - $ref: '#/components/schemas/DiscountCodeCollectionSelection'
            - $ref: '#/components/schemas/DiscountCodeSKUSelection'
        start_date:
          type: string
          format: date-time
          description: Date from which the discount code should be considered valid (optional).
        expiry_date:
          type: string
          format: date-time
          description: Date from which the discount code should be considered expired/invalid (optional).
        restrict_by_emails:
          type: array
          maxItems: 50
          description: This optional field can be used to make the discount code valid only for certain customers (defined by their email addresses).
          items:
            type: string
        limits:
          type: array
          description: If a discount code can be used only a limited amount of times (per customer, or in the entire shop) those optional limits can be defined here.
          items:
            $ref: '#/components/schemas/UsageLimit'
        raw_product_selection:
          $ref: '#/components/schemas/DiscountCodeRawProductSelection'
        raw_reward_product_selection:
          $ref: '#/components/schemas/DiscountCodeRawProductSelection'
      required:
        - codes
        - action
        - product_selection
    DiscountCodeProductSelection:
      title: DiscountCodeProductSelection
      type: object
      description: Expression to filter which products should be eligible for a discount code.
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - PRODUCT_SEARCH
            - PRODUCTS_EXCEPT
          description: The type of selection; the discount code can be applicable to specific products/variants or to the entire store.
        product_ids:
          type: array
          description: List of product ids eligible for the discount code.
          items:
            type: string
      required:
        - type
        - product_ids
    DiscountCodeVariantSelection:
      title: DiscountCodeVariantSelection
      type: object
      additionalProperties: false
      description: Expression to filter which variants should be eligible for a discount code.
      properties:
        type:
          type: string
          description: The type of selection; the discount code can be applicable to specific products/variants or to the entire store.
          enum:
            - PRODUCT_SEARCH
            - PRODUCTS_EXCEPT
        variant_ids:
          type: array
          description: List of variant ids eligible for the discount code.
          items:
            type: string
      required:
        - type
        - variant_ids
    DiscountCode:
      title: DiscountCode
      type: object
      additionalProperties: false
      description: A set of fields that describes the behaviour of a discount code, where it applies and how it affects the product prices.
      properties:
        id:
          type: integer
        code:
          type: string
          description: The discount code name (to be used during checkout).
        discount_summary:
          type: string
          description: The discount code summary.
        is_active:
          type: string
          format: date-time
          description: ''
        start_date:
          nullable: true
          type: string
          format: date-time
          description: Start date when the discount code shall be available for use.
        expiry_date:
          nullable: true
          type: string
          format: date-time
          description: Date when the discount code expires.
        created_at:
          type: string
          format: date-time
          description: Date when the discount code was originally created.
        updated_at:
          type: string
          format: date-time
          description: Date when the discount code was last updated.
        restrict_by_emails:
          type: array
          description: This optional field informs when the discount code is valid only for certain customers (defined by their email addresses).
          items:
            type: string
        ruleset:
          $ref: '#/components/schemas/DiscountCodeRuleset'
        limits:
          type: array
          description: If the discount code usage limits (for example, it can be used just one time per customer) these limits will be listed in this field.
          items:
            $ref: '#/components/schemas/UsageLimit'
        product_selection:
          $ref: '#/components/schemas/DiscountCodeRawProductSelection'
        reward_product_selection:
          $ref: '#/components/schemas/DiscountCodeRawProductSelection'
    UsageLimit:
      title: UsageLimit
      type: object
      description: If a discount code has usage limits, this object will describe those limits.
      properties:
        limit_type:
          type: string
          enum:
            - per_customer
            - per_shop
          description: When a discount code has a usage limit, the limit can be applied per customer or for the entire shop.
        limit_amount:
          type: integer
          description: This describes the maximum amount of allowed usages for a limited discount code.
          minimum: 1
      required:
        - limit_type
        - limit_amount
      additionalProperties: false
    UpdateDiscountCode:
      title: UpdateDiscountCode
      type: object
      description: Payload to update an existing discount code.
      additionalProperties: false
      properties:
        code:
          type: string
          description: The discount code name (to be used during checkout). When updating, you don't need to provide the code unless you are changing it.
        conditions:
          type: array
          description: Extra requirements for the discount code to be considered eligible. This is an optional field.
          items:
            anyOf:
              - $ref: '#/components/schemas/ConditionCartSubtotalMin'
              - $ref: '#/components/schemas/ConditionShippingRateRange'
              - $ref: '#/components/schemas/ConditionQtyOnCart'
              - $ref: '#/components/schemas/ConditionCustomerInAnyGroupFromList'
              - $ref: '#/components/schemas/ConditionCustomerCountry'
              - $ref: '#/components/schemas/ConditionBuyXGetYDiscountCode'
        action:
          oneOf:
            - $ref: '#/components/schemas/ActionPriceAdjustRelative'
            - $ref: '#/components/schemas/ActionPriceAdjustPercent'
            - $ref: '#/components/schemas/ActionFreeShipping'
            - $ref: '#/components/schemas/ActionShippingAdjustRelative'
            - $ref: '#/components/schemas/ActionShippingAdjustPercent'
            - $ref: '#/components/schemas/ActionCartAdjustRelative'
            - $ref: '#/components/schemas/ActionCartAdjustPercent'
        limit:
          $ref: '#/components/schemas/UsageLimit'
        product_selection:
          oneOf:
            - $ref: '#/components/schemas/DiscountCodeProductSelection'
            - $ref: '#/components/schemas/DiscountCodeVariantSelection'
            - $ref: '#/components/schemas/DiscountCodeAllSelection'
            - $ref: '#/components/schemas/DiscountCodeCollectionSelection'
            - $ref: '#/components/schemas/DiscountCodeSKUSelection'
        start_date:
          type: string
          format: date-time
          description: Date from which the discount code should be considered valid (optional).
        expiry_date:
          type: string
          format: date-time
          description: Date from which the discount code should be considered expired/invalid (optional).
        restrict_by_emails:
          type: array
          maxItems: 50
          description: This optional field can be used to make the discount code valid only for certain customers (defined by their email addresses).
          items:
            type: string
        limits:
          type: array
          description: If a discount code can be used only a limited amount of times (per customer, or in the entire shop) those optional limits can be defined here.
          items:
            $ref: '#/components/schemas/UsageLimit'
        raw_product_selection:
          $ref: '#/components/schemas/DiscountCodeRawProductSelection'
        raw_reward_product_selection:
          $ref: '#/components/schemas/DiscountCodeRawProductSelection'
      required:
        - action
        - product_selection
    DiscountCodeRuleset:
      title: DiscountCodeRuleset
      type: object
      description: A set of rules that can apply to a defined group of products, depending on the rule conditions being met. Used to change the price in conjuction with a discount code.
      properties:
        id:
          type: integer
          description: Ruleset database ID.
        external_id:
          type: string
          description: This is the string identifier for the ruleset, it is auto generated based in the discount code name.
        active:
          type: boolean
          description: Indicates if this ruleset is currently active.
        internal_name:
          type: string
          description: This is the name of the ruleset, it is auto generated based in the discount code name.
        created_at:
          type: string
          format: date-time
          description: Ruleset creation date.
        updated_at:
          type: string
          format: date-time
          description: If the ruleset was altered, this will be the most recent date in which any changes occurred.
        start_date:
          type: string
          format: date-time
          description: Date from which the discount code should be considered valid (optional).
        expiry_date:
          type: string
          format: date-time
          description: Date from which the discount code should be considered expired/invalid (optional).
        rules:
          type: array
          description: Each one of the rules contained in this ruleset.
          items:
            $ref: '#/components/schemas/Rule'
        product_selection:
          oneOf:
            - $ref: '#/components/schemas/DiscountCodeProductSelection'
            - $ref: '#/components/schemas/DiscountCodeVariantSelection'
            - $ref: '#/components/schemas/DiscountCodeAllSelection'
            - $ref: '#/components/schemas/DiscountCodeCollectionSelection'
            - $ref: '#/components/schemas/DiscountCodeSKUSelection'
    DiscountCodeAllSelection:
      title: DiscountCodeAllSelection
      type: object
      description: Expression used to determine that all products in the store should be eligible to the discount code.
      properties:
        type:
          type: string
          enum:
            - PRODUCTS_ALL
          description: The type of selection; the discount code can be applicable to specific products/variants or to the entire store.
      required:
        - type
    RuleResponse:
      title: RuleResponse
      type: object
      properties:
        id:
          type: string
          description: rule_id
        external_id:
          type: string
          description: Rule's external id if exists
        conditions:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/ConditionQtyByLine'
              - $ref: '#/components/schemas/ConditionQtyByVariant'
              - $ref: '#/components/schemas/ConditionQtyByProduct'
              - $ref: '#/components/schemas/ConditionQtyByMixAndMatch'
              - $ref: '#/components/schemas/ConditionCustomerGroup'
              - $ref: '#/components/schemas/ConditionCustomerProvince'
              - $ref: '#/components/schemas/ConditionLineItemProperty'
              - $ref: '#/components/schemas/ConditionRefUrl'
              - $ref: '#/components/schemas/ConditionQtyByBundle'
              - $ref: '#/components/schemas/ConditionSubscriptionGroup'
              - $ref: '#/components/schemas/ConditionSubscriptionInterval'
              - $ref: '#/components/schemas/ConditionCurrency'
        actions:
          type: array
          items:
            anyOf:
              - $ref: '#/components/schemas/ActionPriceAdjustAbsolute'
              - $ref: '#/components/schemas/ActionPriceAdjustRelative'
              - $ref: '#/components/schemas/ActionPriceAdjustPercent'
              - $ref: '#/components/schemas/ActionPriceAdjustAbsoluteWithLimit'
              - $ref: '#/components/schemas/ActionPriceAdjustRelativeWithLimit'
              - $ref: '#/components/schemas/ActionCharmPrice'
              - $ref: '#/components/schemas/ActionAdjustRate'
              - $ref: '#/components/schemas/ActionAddFee'
              - $ref: '#/components/schemas/ActionDisplayQtyBreak'
              - $ref: '#/components/schemas/ActionCustomerDraftOrderTaxable'
    ActionFreeShipping:
      type: object
      title: ActionFreeShipping
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - FREE_SHIPPING
      required:
        - type
    ActionShippingAdjustRelative:
      type: object
      title: ActionShippingAdjustRelative
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - SHIPPING_ADJUST_RELATIVE
        value:
          type: integer
      required:
        - type
        - value
      description: ''
    ActionShippingAdjustPercent:
      type: object
      title: ActionShippingAdjustPercent
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - SHIPPING_ADJUST_PERCENT
        value:
          type: integer
      required:
        - type
        - value
    LineItem:
      title: LineItem
      type: object
      x-examples:
        example-1:
          key: string
          price: 0
          id: string
          quantity: 0
      properties:
        key:
          type: string
          description: key of lineItem
        price:
          type: integer
        id:
          type: string
          description: 'Example: sku_id/product_id'
        quantity:
          type: integer
      required:
        - key
        - price
        - id
        - quantity
    ProcessLineItem:
      title: LineItem
      type: object
      x-examples:
        example-1:
          key: string
          price: 0
          id: string
          quantity: 0
      properties:
        key:
          type: string
          description: key of lineItem
        price:
          type: integer
        matchValue:
          type: string
          description: 'Example: sku_id/product_id'
        quantity:
          type: integer
      required:
        - key
        - price
        - matchValue
        - quantity
    BestProductPriceAction:
      title: BestProductPriceAction
      type: object
      properties:
        type:
          type: string
          description: ''
          enum:
            - BEST_ITEM_PRICE
        sku:
          type: string
        variant_id:
          type: string
        value:
          type: number
          description: Final discounted price of the variant
        rule:
          type: array
          items:
            $ref: '#/components/schemas/LineItemRule'
    Customer:
      title: Customer
      type: object
      properties:
        email:
          type: string
        shipping:
          $ref: '#/components/schemas/CustomerShippingSchema'
      x-examples:
        example-1:
          value:
            email: string
            shipping:
              postal_code: string
              country: string
              country_code: string
              province: string
              province_code: string
    CartAction:
      title: CartAction
      type: object
      properties:
        type:
          type: string
          enum:
            - SET_LINE_ITEM_PRICE
        line_item_key:
          type: string
        value:
          type: integer
        rule:
          type: array
          items:
            $ref: '#/components/schemas/LineItemRule'
        variant_id:
          type: string
    LineItemRule:
      title: LineItemRule
      type: object
      properties:
        id:
          type: integer
          description: rule id
        rule_set_id:
          type: integer
          description: ruleset id
        rule_set_eid:
          type: string
          description: external id of ruleset if exist
        type:
          type: string
          enum:
            - DISCOUNT
            - ADDITION
        eid:
          type: string
          description: external id of rule if exist
        rule_set_public_message:
          type: string
          description: public message of ruleset if exist
    ActionCartAdjustRelative:
      type: object
      title: ActionCartAdjustRelative
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - CART_ADJUST_RELATIVE
        value:
          type: number
      required:
        - type
        - value
      x-examples:
        example-1:
          type: CART_ADJUST_RELATIVE
          value: 0
    ConditionCartSubtotalMin:
      type: object
      title: ConditionCartSubtotalMin
      additionalProperties: false
      description: This condition is used by discount codes, and it defines a minimum cart subtotal amount for the order to be considered eligible to a certain discount code.
      properties:
        type:
          type: string
          enum:
            - CART_SUBTOTAL_MIN
          description: Condition type, for this condition it should be always CART_SUBTOTAL_MIN.
        value:
          type: integer
          description: Value to be used as the minimum cart total required; the amount is always an integer, so values like $8.99 should be given as 899, and full values as $5 should be given as 500.
      required:
        - type
        - value
    ActionCartAdjustPercent:
      type: object
      title: ActionCartAdjustPercent
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - CART_ADJUST_PERCENT
        value:
          type: number
      required:
        - type
        - value
      x-examples:
        example-1:
          type: CART_ADJUST_PERCENT
          value: 0
    ConditionShippingRateRange:
      type: object
      title: ConditionShippingRateRange
      additionalProperties: false
      description: This condition is used by discount codes, and it defines a minimum and a maximum shipping rate value for the order to be considered eligible to a certain discount code.
      properties:
        type:
          type: string
          enum:
            - SHIPPING_RATE_RANGE
          description: Condition type, for this condition it should be always SHIPPING_RATE_RANGE.
        min_value:
          type: integer
          description: Value to be used as the minimum shiping rate accepted; the amount is always an integer, so values like $8.99 should be given as 899, and full values as $5 should be given as 500.
        max_value:
          type: integer
          description: Value to be used as the maximum shiping rate accepted; the amount is always an integer, so values like $8.99 should be given as 899, and full values as $5 should be given as 500.
      required:
        - type
    BasicPatchRuleset:
      description: A set of rules that can apply to a defined group of products, depending on the rule conditions being met. The basic patch ruleset type refers to the fields that should be passed when updating a ruleset.
      type: object
      x-examples:
        example-1:
          ruleset:
            start_date: '2020-12-07T15:28:15.000-06:00'
            expiry_date: '2020-12-08T15:28:15.000-06:00'
            rules:
              - type: DISCOUNT
                conditions:
                  - value: 5
                    type: QTY_BY_LINE
                    operator: '='
                    requiresPrepare: true
                actions:
                  - value: 99
                    type: PRICE_ADJUST_ABSOLUTE
                meta: {}
                external_id: realExternalId
      properties:
        ruleset:
          type: object
          required:
            - rules
          properties:
            start_date:
              type: string
              format: date-time
            expiry_date:
              type: string
              format: date-time
            rules:
              type: array
              uniqueItems: true
              minItems: 1
              items:
                $ref: '#/components/schemas/Rule'
      required:
        - ruleset
    DiscountCodeCollectionSelection:
      type: object
      title: DiscountCodeCollectionSelection
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - PRODUCT_SEARCH
            - PRODUCTS_EXCEPT
        collection_ids:
          type: array
          items:
            type: string
      required:
        - type
        - collection_ids
      description: Expression to filter which collections should be eligible for a discount code.
    ConditionQtyOnCart:
      title: ConditionQtyOnCart
      type: object
      description: This condition is used by discount codes, and it defines a minimum amount of items in the cart for it to be considered eligible to a certain discount code.
      properties:
        type:
          type: string
          enum:
            - QTY_ON_CART
          description: Condition type, for this condition it should be always QTY_ON_CART.
        value:
          type: integer
          description: The minimum amount of items that must be in the cart for the code to be applicable.
      required:
        - type
        - value
    ConditionCustomerId:
      title: ConditionCustomerId
      type: object
      x-examples:
        example-1:
          value:
            type: CUSTOMER_ID
            value: some_email@gmail.com
      properties:
        type:
          type: string
          description: CUSTOMER_ID
        value:
          type: string
          description: A customer's email address
      description: This ruleset condition allows giving specific customers a discount. To enable this condition, please contact our support team.
    ConditionCustomerInAnyGroupFromList:
      title: ConditionCustomerInAnyGroupFromList
      type: object
      description: This condition is used by discount codes, and it defines a list of groups related to the code. If the customer belongs to any of these groups, they are eligible for the discount code.
      properties:
        type:
          type: string
          enum:
            - CUSTOMER_IN_ANY_GROUP_FROM_LIST
          description: Condition type, for this condition it should be always CUSTOMER_IN_ANY_GROUP_FROM_LIST.
        list:
          type: array
          description: List of groups to check and see if the customer belongs to any of them.
          items:
            type: string
      required:
        - type
        - list
    ConditionCustomerCountry:
      title: ConditionCustomerCountry
      type: object
      description: This condition is used by discount codes, and it defines a list of countries in which the discount code should be considered valid.
      properties:
        type:
          type: string
          enum:
            - CUSTOMER_COUNTRY
          description: Condition type, for this condition it should be always CUSTOMER_COUNTRY.
        list:
          type: array
          description: 'List of countries (alpha 2 codes, defined on ISO 3166-2) to check and see if the customer address belongs to any of them. Examples: US, CA, FR. The the proper code for each country can be obtained here: https://www.iso.org/obp/ui/#search'
          items:
            type: string
      required:
        - type
        - list
    ConditionBuyXGetYDiscountCode:
      type: object
      title: ConditionBuyXGetYDiscountCode
      description: 'This condition is used exclusively by discount codes, and it describes a "Buy X Get Y" situation, in which you need to buy one or more required products to receive a % discount in one or more reward products. Important: this condition is only compatible with the action type PRICE_ADJUST_PERCENT.'
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - BUY_X_GET_Y_DISCOUNT_CODE
          description: Condition type, for this condition it should be always BUY_X_GET_Y_DISCOUNT_CODE.
        buy_quantity:
          type: integer
          minimum: 1
          description: The minimum amount of products that must be bought to qualify the cart for this discount code.
        get_quantity:
          type: integer
          minimum: 1
          description: The maximum amount of products that can be discounted if the cart qualifies for this discount code.
        uses_per_order:
          type: integer
          minimum: 1
          description: In case a cart can qualify more than once for a code (for example, when using a "Buy 3 Get 2" discount code in a cart that has 9 required products and 6 reward products) this limits how many times the same discount can be applied for that order. If it is not provided, the default is 1.
        requirement_selection:
          oneOf:
            - $ref: '#/components/schemas/RequirementSelectionWithProducts'
            - $ref: '#/components/schemas/RequirementSelectionWithCollections'
            - $ref: '#/components/schemas/RequirementSelectionWithVariants'
            - $ref: '#/components/schemas/RequirementSelectionWithSKUs'
      required:
        - type
        - buy_quantity
        - get_quantity
        - requirement_selection
    RequirementSelectionWithProducts:
      type: object
      title: RequirementSelectionWithProducts
      description: This is used to list what are the requirements when configuring a "Buy X Get Y" discount code. Here you can list all the platform product ids that are accepted as qualifying items for a "Buy X Get Y" discount type.
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - PRODUCT_SEARCH
          description: Currently, the only type of selection supported is PRODUCT_SEARCH (that works for products, variants and collections).
        product_ids:
          type: array
          description: The list of product ids that are accepted as requirements to compose the "Buy X Get Y" promotion.
          items:
            type: string
            minLength: 1
      required:
        - type
        - product_ids
    RequirementSelectionWithCollections:
      title: RequirementSelectionWithCollections
      type: object
      description: This is used to list what are the requirements when configuring a "Buy X Get Y" discount code. Here you can list all the platform collection ids that are accepted as qualifying items for a "Buy X Get Y" discount type.
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - PRODUCT_SEARCH
          description: Currently, the only type of selection supported is PRODUCT_SEARCH (that works for products, variants and collections).
        collection_ids:
          type: array
          description: The list of collection ids that are accepted as requirements to compose the "Buy X Get Y" promotion.
          items:
            type: string
            minLength: 1
      required:
        - type
        - collection_ids
    RequirementSelectionWithVariants:
      type: object
      title: RequirementSelectionWithVariants
      description: This is used to list what are the requirements when configuring a "Buy X Get Y" discount code. Here you can list all the platform variant ids that are accepted as qualifying items for a "Buy X Get Y" discount type.
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - PRODUCT_SEARCH
          description: Currently, the only type of selection supported is PRODUCT_SEARCH (that works for products, variants and collections).
        variant_ids:
          type: array
          description: The list of variant ids that are accepted as requirements to compose the "Buy X Get Y" promotion.
          items:
            type: string
            minLength: 1
      required:
        - type
        - variant_ids
    RequirementSelectionWithSKUs:
      type: object
      title: RequirementSelectionWithSKUs
      description: This is used to list what are the requirements when configuring a "Buy X Get Y" discount code. Here you can list all the product SKUs that are accepted as qualifying items for a "Buy X Get Y" discount type.
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - PRODUCT_SEARCH
          description: Currently, the only type of selection supported is PRODUCT_SEARCH (that works for products, variants, SKUs and collections).
        sku_ids:
          type: array
          description: The list of SKUs that are accepted as requirements to compose the "Buy X Get Y" promotion.
          items:
            type: string
            minLength: 1
      required:
        - type
        - sku_ids
    ActionPriceAdjustAbsoluteBasePrice:
      title: ActionPriceAdjustAbsoluteBasePrice
      type: object
      properties:
        value:
          type: integer
          example: 299
        type:
          type: string
          enum:
            - PRICE_ADJUST_ABSOLUTE_BASE_PRICE
    ConditionCurrency:
      title: ConditionCurrency
      type: object
      properties:
        type:
          type: string
        value:
          type: string
          enum:
            - CURRENCY
    DiscountCodeRawProductSelection:
      title: DiscountCodeRawProductSelection
      type: object
      properties:
        type:
          type: string
          enum:
            - PRODUCT
            - COLLECTION
        selections:
          type: array
          items: {}
    ActionAdjustRate:
      title: ActionAdjustRate
      type: object
      properties:
        type:
          type: string
          enum:
            - PRICE_ADJUST_RATE
        value:
          type: number
      required:
        - type
        - value
    TaggedCustomer:
      title: TaggedCustomer
      type: object
      properties:
        tags:
          type: string
          description: |-
            Comma separated string like "vip,gold
            "
        email:
          type: string
          description: Email address
        shipping:
          $ref: '#/components/schemas/CustomerShippingSchema'
    DiscountCodeSKUSelection:
      title: DiscountCodeSKUSelection
      type: object
      description: Expression to filter which product SKUs should be eligible for a discount code.
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - PRODUCT_SEARCH
          description: The type of selection; the discount code can be applicable to specific products/variants/SKUs or to the entire store.
        sku_ids:
          type: array
          description: List of product SKUs eligible for the discount code.
          items:
            type: string
      required:
        - type
        - sku_ids
    OrderConditionCustomerSchema:
      title: OrderConditionCustomerSchema
      type: object
      properties:
        shipping:
          $ref: '#/components/schemas/CustomerShippingSchema'
    CustomerShippingSchema:
      title: CustomerShippingSchema
      type: object
      properties:
        postal_code:
          type: string
        country:
          type: string
        country_code:
          type: string
        province:
          type: string
        province_code:
          type: string
