Skip to main content
POST
/
vendor
/
promotions
/
{id}
/
target-rules
/
batch
Batch target rules
curl --request POST \
  --url https://api.example.com/vendor/promotions/{id}/target-rules/batch \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "create": [
    {
      "description": "<string>",
      "attribute": "<string>",
      "operator": "in",
      "values": [
        "<string>"
      ]
    }
  ],
  "delete": [
    "<string>"
  ]
}
'
{
  "promotion": {
    "id": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z",
    "code": "<string>",
    "is_automatic": true,
    "type": "<string>",
    "application_method": {
      "id": "<string>",
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z",
      "description": "<string>",
      "value": 123,
      "max_quantity": "<string>",
      "apply_to_quantity": "<string>",
      "buy_rules_min_quantity": "<string>",
      "type": "<string>",
      "target_type": "<string>",
      "allocation": "<string>",
      "target_rules": [
        {
          "id": "<string>",
          "created_at": "2023-11-07T05:31:56Z",
          "updated_at": "2023-11-07T05:31:56Z",
          "description": "<string>",
          "attribute": "<string>",
          "operator": "<string>",
          "values": [
            {
              "value": "<string>"
            }
          ]
        }
      ]
    },
    "rules": [
      {
        "id": "<string>",
        "created_at": "2023-11-07T05:31:56Z",
        "updated_at": "2023-11-07T05:31:56Z",
        "description": "<string>",
        "attribute": "<string>",
        "operator": "<string>",
        "values": [
          {
            "value": "<string>"
          }
        ]
      }
    ]
  }
}

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 ID of the promotion.

Body

application/json
create
object[]

Rules to create.

delete
string[]

Rules to delete.

Response

201 - application/json

Created

promotion
Promotion · object

Promotion object