Promo Codes

Promo codes can be created for a given price rule. All the promo codes under a price rule share the generic information defined for that rule like the amount, type, expiration date etc. Promo code defines the more specific information about a promo code like the actual code, redemption_url, usage_count, etc that’s unique to a code. Promo Code must be defined under a promo rule.

Available methods

    • Add a new promo code to a store

      POST /ecommerce/stores/{store_id}/promo-rules/{promo_rule_id}/promo-codes

      Add a new promo code to a store.

      Path parameters

      store_id The store id.

      Request body parameters

      id Type: String Title: Promo Code Foreign ID Read only: false A unique identifier for the promo code. Restricted to UTF-8 characters with max length 50.
      code Type: String Title: Promo Code Read only: false The discount code. Restricted to UTF-8 characters with max length 50.
      redemption_url Type: String Title: Redemption Url Read only: false The url that should be used in the promotion campaign restricted to UTF-8 characters with max length 2000.
      usage_count Type: Integer Title: Promo Code Usage Count Read only: false Number of times promo code has been used.
      enabled Type: Boolean Title: Enabled Read only: false Whether the promo code is currently enabled.
      created_at_foreign Type: String Title: Foreign Create Time Read only: false The date and time the promotion was created in ISO 8601 format.
      updated_at_foreign Type: String Title: Foreign Update Time Read only: false The date and time the promotion was updated in ISO 8601 format.

      Response body parameters

      id Type: String Title: Promo Code Foreign ID Read only: false A unique identifier for the promo Code.
      code Type: String Title: Promo Code Read only: false The discount code. Restricted to UTF-8 characters with max length 50.
      redemption_url Type: String Title: Redemption Url Read only: false The url that should be used in the promotion campaign restricted to UTF-8 characters with max length 2000.
      usage_count Type: Integer Title: Promo Code Usage Count Read only: false Number of times promo code has been used.
      enabled Type: Boolean Title: Enabled Read only: false Whether the promo code is currently enabled.
      created_at_foreign Type: String Title: Foreign Create Time Read only: false The date and time the promotion was created in ISO 8601 format.
      updated_at_foreign Type: String Title: Foreign Update Time Read only: false The date and time the promotion was updated in ISO 8601 format.
      _links Type: Array Title: Links Read only: true A list of link types and descriptions for the API schema documents.
      Show properties
      rel Type: String Title: Rel Read only: true As with an HTML ‘rel’ attribute, this describes the type of link.
      href Type: String Title: Href Read only: true This property contains a fully-qualified URL that can be called to retrieve the linked resource or perform the linked action.
      method Type: String Title: Method Read only: true The HTTP method that should be used when accessing the URL defined in ‘href’.
      Possible Values:
      • GET
      • POST
      • PUT
      • PATCH
      • DELETE
      • OPTIONS
      • HEAD
      targetSchema Type: String Title: Target Schema Read only: true For GETs, this is a URL representing the schema that the response should conform to.
      schema Type: String Title: Schema Read only: true For HTTP methods that can receive bodies (POST and PUT), this is a URL representing the schema that the body should conform to.

      Error response

      type Type: String Title: Problem Type Read only: false An absolute URI that identifies the problem type. When dereferenced, it should provide human-readable documentation for the problem type.
      title Type: String Title: Error Title Read only: false A short, human-readable summary of the problem type. It shouldn’t change based on the occurrence of the problem, except for purposes of localization.
      status Type: Integer Title: HTTP Status Code Read only: false The HTTP status code (RFC2616, Section 6) generated by the origin server for this occurrence of the problem.
      detail Type: String Title: Error Message Read only: false A human-readable explanation specific to this occurrence of the problem. Learn more about errors.
      instance Type: String Title: Instance ID Read only: false A string that identifies this specific occurrence of the problem. Please provide this ID when contacting support.
    • Get information about a store's promo codes

      GET /ecommerce/stores/{store_id}/promo-rules/{promo_rule_id}/promo-codes

      Get information about a store’s promo codes.

      Path parameters

      store_id The store id.

      Query string parameters

      fields Type: Array Title: Fields Read only: false A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.
      exclude_fields Type: Array Title: Exclude Fields Read only: false A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation.
      count Type: Integer Title: Count Read only: true The number of records to return. Default value is 10.
      offset Type: Integer Title: Offset Read only: false The number of records from a collection to skip. Iterating over large collections with this parameter can be slow. Default value is 0.

      Response body parameters

      store_id Type: String Title: Store ID Read only: false The store id.
      promo_codes Type: Array Title: Promo Codes Read only: false An array of objects, each representing promo codes defined for a store.
      Show properties
      id Type: String Title: Promo Code Foreign ID Read only: false A unique identifier for the promo Code.
      code Type: String Title: Promo Code Read only: false The discount code. Restricted to UTF-8 characters with max length 50.
      redemption_url Type: String Title: Redemption Url Read only: false The url that should be used in the promotion campaign restricted to UTF-8 characters with max length 2000.
      usage_count Type: Integer Title: Promo Code Usage Count Read only: false Number of times promo code has been used.
      enabled Type: Boolean Title: Enabled Read only: false Whether the promo code is currently enabled.
      created_at_foreign Type: String Title: Foreign Create Time Read only: false The date and time the promotion was created in ISO 8601 format.
      updated_at_foreign Type: String Title: Foreign Update Time Read only: false The date and time the promotion was updated in ISO 8601 format.
      _links Type: Array Title: Links Read only: true A list of link types and descriptions for the API schema documents.
      Show properties
      rel Type: String Title: Rel Read only: true As with an HTML ‘rel’ attribute, this describes the type of link.
      href Type: String Title: Href Read only: true This property contains a fully-qualified URL that can be called to retrieve the linked resource or perform the linked action.
      method Type: String Title: Method Read only: true The HTTP method that should be used when accessing the URL defined in ‘href’.
      Possible Values:
      • GET
      • POST
      • PUT
      • PATCH
      • DELETE
      • OPTIONS
      • HEAD
      targetSchema Type: String Title: Target Schema Read only: true For GETs, this is a URL representing the schema that the response should conform to.
      schema Type: String Title: Schema Read only: true For HTTP methods that can receive bodies (POST and PUT), this is a URL representing the schema that the body should conform to.
      total_items Type: Integer Title: Item Count Read only: false The total number of items matching the query regardless of pagination.
      _links Type: Array Title: Links Read only: true A list of link types and descriptions for the API schema documents.
      Show properties
      rel Type: String Title: Rel Read only: true As with an HTML ‘rel’ attribute, this describes the type of link.
      href Type: String Title: Href Read only: true This property contains a fully-qualified URL that can be called to retrieve the linked resource or perform the linked action.
      method Type: String Title: Method Read only: true The HTTP method that should be used when accessing the URL defined in ‘href’.
      Possible Values:
      • GET
      • POST
      • PUT
      • PATCH
      • DELETE
      • OPTIONS
      • HEAD
      targetSchema Type: String Title: Target Schema Read only: true For GETs, this is a URL representing the schema that the response should conform to.
      schema Type: String Title: Schema Read only: true For HTTP methods that can receive bodies (POST and PUT), this is a URL representing the schema that the body should conform to.

      Error response

      type Type: String Title: Problem Type Read only: false An absolute URI that identifies the problem type. When dereferenced, it should provide human-readable documentation for the problem type.
      title Type: String Title: Error Title Read only: false A short, human-readable summary of the problem type. It shouldn’t change based on the occurrence of the problem, except for purposes of localization.
      status Type: Integer Title: HTTP Status Code Read only: false The HTTP status code (RFC2616, Section 6) generated by the origin server for this occurrence of the problem.
      detail Type: String Title: Error Message Read only: false A human-readable explanation specific to this occurrence of the problem. Learn more about errors.
      instance Type: String Title: Instance ID Read only: false A string that identifies this specific occurrence of the problem. Please provide this ID when contacting support.

      Get information about a specific promo code

      GET /ecommerce/stores/{store_id}/promo-rules/{promo_rule_id}/promo-codes/{promo_code_id}

      Get information about a specific promo code.

      Path parameters

      store_id The store id.
      promo_rule_id The id for the promo rule of a store.
      promo_code_id The id for the promo code of a store.

      Query string parameters

      fields Type: Array Title: Fields Read only: false A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.
      exclude_fields Type: Array Title: Exclude Fields Read only: false A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation.

      Response body parameters

      id Type: String Title: Promo Code Foreign ID Read only: false A unique identifier for the promo Code.
      code Type: String Title: Promo Code Read only: false The discount code. Restricted to UTF-8 characters with max length 50.
      redemption_url Type: String Title: Redemption Url Read only: false The url that should be used in the promotion campaign restricted to UTF-8 characters with max length 2000.
      usage_count Type: Integer Title: Promo Code Usage Count Read only: false Number of times promo code has been used.
      enabled Type: Boolean Title: Enabled Read only: false Whether the promo code is currently enabled.
      created_at_foreign Type: String Title: Foreign Create Time Read only: false The date and time the promotion was created in ISO 8601 format.
      updated_at_foreign Type: String Title: Foreign Update Time Read only: false The date and time the promotion was updated in ISO 8601 format.
      _links Type: Array Title: Links Read only: true A list of link types and descriptions for the API schema documents.
      Show properties
      rel Type: String Title: Rel Read only: true As with an HTML ‘rel’ attribute, this describes the type of link.
      href Type: String Title: Href Read only: true This property contains a fully-qualified URL that can be called to retrieve the linked resource or perform the linked action.
      method Type: String Title: Method Read only: true The HTTP method that should be used when accessing the URL defined in ‘href’.
      Possible Values:
      • GET
      • POST
      • PUT
      • PATCH
      • DELETE
      • OPTIONS
      • HEAD
      targetSchema Type: String Title: Target Schema Read only: true For GETs, this is a URL representing the schema that the response should conform to.
      schema Type: String Title: Schema Read only: true For HTTP methods that can receive bodies (POST and PUT), this is a URL representing the schema that the body should conform to.

      Error response

      type Type: String Title: Problem Type Read only: false An absolute URI that identifies the problem type. When dereferenced, it should provide human-readable documentation for the problem type.
      title Type: String Title: Error Title Read only: false A short, human-readable summary of the problem type. It shouldn’t change based on the occurrence of the problem, except for purposes of localization.
      status Type: Integer Title: HTTP Status Code Read only: false The HTTP status code (RFC2616, Section 6) generated by the origin server for this occurrence of the problem.
      detail Type: String Title: Error Message Read only: false A human-readable explanation specific to this occurrence of the problem. Learn more about errors.
      instance Type: String Title: Instance ID Read only: false A string that identifies this specific occurrence of the problem. Please provide this ID when contacting support.
    • Update a promo code

      PATCH /ecommerce/stores/{store_id}/promo-rules/{promo_rule_id}/promo-codes/{promo_code_id}

      Update a promo code.

      Path parameters

      store_id The store id.
      promo_rule_id The id for the promo rule of a store.
      promo_code_id The id for the promo code of a store.

      Request body parameters

      code Type: String Title: Promo Code Read only: false The discount code. Restricted to UTF-8 characters with max length 50.
      redemption_url Type: String Title: Redemption Url Read only: false The url that should be used in the promotion campaign restricted to UTF-8 characters with max length 2000.
      usage_count Type: Integer Title: Promo Code Usage Count Read only: false Number of times promo code has been used.
      enabled Type: Boolean Title: Enabled Read only: false Whether the promo code is currently enabled.
      created_at_foreign Type: String Title: Foreign Create Time Read only: false The date and time the promotion was created in ISO 8601 format.
      updated_at_foreign Type: String Title: Foreign Update Time Read only: false The date and time the promotion was updated in ISO 8601 format.

      Response body parameters

      id Type: String Title: Promo Code Foreign ID Read only: false A unique identifier for the promo Code.
      code Type: String Title: Promo Code Read only: false The discount code. Restricted to UTF-8 characters with max length 50.
      redemption_url Type: String Title: Redemption Url Read only: false The url that should be used in the promotion campaign restricted to UTF-8 characters with max length 2000.
      usage_count Type: Integer Title: Promo Code Usage Count Read only: false Number of times promo code has been used.
      enabled Type: Boolean Title: Enabled Read only: false Whether the promo code is currently enabled.
      created_at_foreign Type: String Title: Foreign Create Time Read only: false The date and time the promotion was created in ISO 8601 format.
      updated_at_foreign Type: String Title: Foreign Update Time Read only: false The date and time the promotion was updated in ISO 8601 format.
      _links Type: Array Title: Links Read only: true A list of link types and descriptions for the API schema documents.
      Show properties
      rel Type: String Title: Rel Read only: true As with an HTML ‘rel’ attribute, this describes the type of link.
      href Type: String Title: Href Read only: true This property contains a fully-qualified URL that can be called to retrieve the linked resource or perform the linked action.
      method Type: String Title: Method Read only: true The HTTP method that should be used when accessing the URL defined in ‘href’.
      Possible Values:
      • GET
      • POST
      • PUT
      • PATCH
      • DELETE
      • OPTIONS
      • HEAD
      targetSchema Type: String Title: Target Schema Read only: true For GETs, this is a URL representing the schema that the response should conform to.
      schema Type: String Title: Schema Read only: true For HTTP methods that can receive bodies (POST and PUT), this is a URL representing the schema that the body should conform to.

      Error response

      type Type: String Title: Problem Type Read only: false An absolute URI that identifies the problem type. When dereferenced, it should provide human-readable documentation for the problem type.
      title Type: String Title: Error Title Read only: false A short, human-readable summary of the problem type. It shouldn’t change based on the occurrence of the problem, except for purposes of localization.
      status Type: Integer Title: HTTP Status Code Read only: false The HTTP status code (RFC2616, Section 6) generated by the origin server for this occurrence of the problem.
      detail Type: String Title: Error Message Read only: false A human-readable explanation specific to this occurrence of the problem. Learn more about errors.
      instance Type: String Title: Instance ID Read only: false A string that identifies this specific occurrence of the problem. Please provide this ID when contacting support.
    • Delete a promo code

      DELETE /ecommerce/stores/{store_id}/promo-rules/{promo_rule_id}/promo-codes/{promo_code_id}

      Delete a promo code from a store.

      Path parameters

      store_id The store id.
      promo_rule_id The id for the promo rule of a store.
      promo_code_id The id for the promo code of a store.

      Error response

      type Type: String Title: Problem Type Read only: false An absolute URI that identifies the problem type. When dereferenced, it should provide human-readable documentation for the problem type.
      title Type: String Title: Error Title Read only: false A short, human-readable summary of the problem type. It shouldn’t change based on the occurrence of the problem, except for purposes of localization.
      status Type: Integer Title: HTTP Status Code Read only: false The HTTP status code (RFC2616, Section 6) generated by the origin server for this occurrence of the problem.
      detail Type: String Title: Error Message Read only: false A human-readable explanation specific to this occurrence of the problem. Learn more about errors.
      instance Type: String Title: Instance ID Read only: false A string that identifies this specific occurrence of the problem. Please provide this ID when contacting support.