Skip to main content
POST
/
admin
/
promotions
/
{id}
/
buy-rules
/
batch
cURL
curl -X POST '{backend_url}/admin/promotions/{id}/buy-rules/batch' \
-H 'Authorization: Bearer {access_token}'
{
  "created": [
    {
      "id": "<string>",
      "values": [
        "cusgroup_123"
      ],
      "description": "<string>",
      "attribute": "customer_group_id",
      "operator": "gt"
    }
  ],
  "updated": [
    {
      "id": "<string>",
      "values": [
        "cusgroup_123"
      ],
      "description": "<string>",
      "attribute": "customer_group_id",
      "operator": "gt"
    }
  ],
  "deleted": {
    "ids": [
      "<string>"
    ],
    "object": "promotion-rule",
    "deleted": true
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

The promotion's ID.

Query Parameters

fields
string

Comma-separated fields that should be included in the returned data. if a field is prefixed with + it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.

Body

application/json

The buy rules to create, update, or delete.

create
object[]

The buy rules to create.

update
object[]

The buy rules to update.

delete
string[]

The buy rules to delete.

A buy rule's ID.

Response

OK

The result of the batch operations.

created
object[]
required

The created buy rules.

updated
object[]
required

The updated buy rules.

deleted
object
required

The details of the deleted buy rules.