Skip to content
Esc
↑↓navigate↵open⌘Jpreview

Create a price relay source rule

Create a reusable source side of a price relay.

POST/api/v1/{team_slug}/{app_slug}/price-relay-source-rules
Authorization
AuthorizationBearer token · headerrequired

Management API token, sent as Authorization: Bearer <token>.

Path parameters
app_slugstringrequired

App slug

team_slugstringrequired

Team slug

Request body
requiredapplication/json

source rule details

activeboolean
filtersinternal_pkg_webserver_v1.InputPriceRelayFilters
Show properties
brand_idsstring[]
category_idsstring[]
collection_idsstring[]
tag_idsstring[]
force_on_saleboolean

Overrides the target's on-sale flag with this value; when omitted the flag is left to relay_on_sale_store_group and the target's own state.

market_slugstringrequired
namestringrequired
percentage_of_sourceinteger
percentage_of_source_decimalsinteger
relay_on_sale_store_group_slugstring

When set, the target inherits its on-sale flag and sale window from this store group's price; omit to leave the target's own. Must be one of store_groups.

relay_status_store_group_slugstringrequired

The target inherits its status from this store group's price; falls back to the target's own status, or the source status when the target has no price yet. Must be one of store_groups.

roundinginternal_pkg_webserver_v1.InputPriceRelayRounding
Show properties
round_downboolean
round_upboolean
targetsstring[]
store_groupsinternal_pkg_webserver_v1.InputPriceRelaySourceStoreGroup[]required

The store groups whose prices are summed into the relayed price.

min items 1
Show properties
Array of internal_pkg_webserver_v1.InputPriceRelaySourceStoreGroup
amount_fromstring

The source price field summed into the target's amount_cents_with_tax: 'amount' (the default), 'sale_price' or 'reference_price'.

sale_price_fromstring

The source price field summed into the target's sale_price_with_tax: 'amount', 'sale_price' or 'reference_price'. Omit to contribute this store group's amount to the summed sale price.

store_group_slugstringrequired
tax_country_codestring
Responses
200

source rule created

datagithub_com_enadhq_nabbit_internal_pkg_webserver_models.PriceRelaySourceRulerequired
Show properties
activeboolean
app_idstring
created_atstring
filtersgithub_com_enadhq_nabbit_internal_pkg_webserver_models.PriceRelayFilters
Show properties
brand_idsstring[] | null
category_idsstring[] | null
collection_idsstring[] | null
tag_idsstring[] | null
force_on_saleboolean | null

Overrides the target's on-sale flag with this value; when omitted the flag is left to relay_on_sale_store_group and the target's own state.

idstring
marketstring
market_slugstring
namestring
percentage_of_sourceinteger | null
percentage_of_source_decimalsinteger | null
relay_on_sale_store_groupstring | null

When set, the target inherits its on-sale flag and sale window from this store group's price; null leaves the target's own. Must be one of store_groups.

relay_status_store_groupstring

The target inherits its status from this store group's price; falls back to the target's own status, or the source status when the target has no price yet. Must be one of store_groups.

roundinggithub_com_enadhq_nabbit_internal_pkg_webserver_models.PriceRelayRounding
Show properties
round_downboolean
round_upboolean
targetsstring[] | null
store_groupsgithub_com_enadhq_nabbit_internal_pkg_webserver_models.PriceRelaySourceStoreGroup[] | null

The store groups whose prices are summed into the relayed price.

Show properties
Array of github_com_enadhq_nabbit_internal_pkg_webserver_models.PriceRelaySourceStoreGroup
amount_fromstring

The source price field summed into the target's amount_cents_with_tax: 'amount' (the default), 'sale_price' or 'reference_price'.

sale_price_fromstring | null

The source price field that feeds the target's sale_price_with_tax: 'amount', 'sale_price' or 'reference_price'. Null contributes this store group's amount to the summed sale price.

store_groupstring
store_group_slugstring
tax_country_codestring | null
updated_atstring
detailsstring[]

Additional contextual information about the response. Used to provide supplementary details beyond the main data payload, such as validation warnings or processing notes

successbooleanrequired
400

Invalid request

detailsstring[]
messagestring
successbooleanrequired
404

Store group or market not found

detailsstring[]
messagestring
successbooleanrequired
500

Internal server error

detailsstring[]
messagestring
successbooleanrequired
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST 'https://api.enad.io/api/v1/string/string/price-relay-source-rules' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "active": true,
  "filters": {
    "brand_ids": [
      "string"
    ],
    "category_ids": [
      "string"
    ],
    "collection_ids": [
      "string"
    ],
    "tag_ids": [
      "string"
    ]
  },
  "force_on_sale": true,
  "market_slug": "string",
  "name": "string",
  "percentage_of_source": 0,
  "percentage_of_source_decimals": 0,
  "relay_on_sale_store_group_slug": "string",
  "relay_status_store_group_slug": "string",
  "rounding": {
    "round_down": true,
    "round_up": true,
    "targets": [
      "string"
    ]
  },
  "store_groups": [
    {
      "amount_from": "string",
      "sale_price_from": "string",
      "store_group_slug": "string"
    }
  ],
  "tax_country_code": "string"
}'
Response
{
  "data": {
    "active": true,
    "app_id": "string",
    "created_at": "string",
    "filters": {
      "brand_ids": [
        "string"
      ],
      "category_ids": [
        "string"
      ],
      "collection_ids": [
        "string"
      ],
      "tag_ids": [
        "string"
      ]
    },
    "force_on_sale": true,
    "id": "string",
    "market": "string",
    "market_slug": "string",
    "name": "string",
    "percentage_of_source": 0,
    "percentage_of_source_decimals": 0,
    "relay_on_sale_store_group": "string",
    "relay_status_store_group": "string",
    "rounding": {
      "round_down": true,
      "round_up": true,
      "targets": [
        "string"
      ]
    },
    "store_groups": [
      {
        "amount_from": "string",
        "sale_price_from": "string",
        "store_group": "string",
        "store_group_slug": "string"
      }
    ],
    "tax_country_code": "string",
    "updated_at": "string"
  },
  "details": [
    "string"
  ],
  "success": true
}