---
search:
  tags:
    - Price Relay Rules
    - POST
seo:
  description: >-
    Create a reusable source side of a price relay. Reference for the POST
    /api/v1/{team_slug}/{app_slug}/price-relay-source-rules endpoint in the
    Management API.
sidebar:
  label: Create a price relay source rule
  badge: POST
title: Create a price relay source rule
type: openapi-operation
---
Create a reusable source side of a price relay.

`POST /api/v1/{team_slug}/{app_slug}/price-relay-source-rules`

**Request body** (`application/json`, required)

source rule details

- `active` (boolean)
- `filters` (internal_pkg_webserver_v1.InputPriceRelayFilters)
- `force_on_sale` (boolean) — 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_slug` (string, required)
- `name` (string, required)
- `percentage_of_source` (integer)
- `percentage_of_source_decimals` (integer)
- `relay_on_sale_store_group_slug` (string) — 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_slug` (string, required) — 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.
- `rounding` (internal_pkg_webserver_v1.InputPriceRelayRounding)
- `store_groups` (internal_pkg_webserver_v1.InputPriceRelaySourceStoreGroup[], required) — The store groups whose prices are summed into the relayed price.
- `tax_country_code` (string)

Request body example:

```json
{
  "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"
}
```

**Responses**

- `200` — source rule created
- `400` — Invalid request
- `404` — Store group or market not found
- `500` — Internal server error

Response example, 200:

```json
{
  "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
}
```
