ResourcesPromotions

Update a promotion

Update promotion settings and optionally replace its phases.

Fields are partial. Omit phases to preserve the current phase set. If phases is present, it replaces every active phase and array order becomes phase position.

PATCH
/v2/promotions/{promotion}

Authorization

bearerAuth storeAuth
AuthorizationBearer <token>

Provide your SellApp API key as a bearer token.

In: header

X-STORE<token>

Select the SellApp store for this API request.

In: header

Path Parameters

promotion*integer

The promotion path parameter.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://sell.app/api/v2/promotions/0" \  -H "Content-Type: application/json" \  -d '{    "name": "Extended launch",    "is_stackable": true  }'
{
  "data": {
    "id": 0,
    "name": "string",
    "status": "active",
    "starts_at": "2019-08-24T14:15:22Z",
    "ends_at": "2019-08-24T14:15:22Z",
    "priority": 0,
    "is_stackable": true,
    "max_redemptions": 1,
    "phases": [
      {
        "id": 0,
        "promotion_id": 0,
        "sort_order": 1,
        "discount_type": "percentage",
        "discount_value": "string",
        "ends_at": "2019-08-24T14:15:22Z",
        "max_redemptions": 1,
        "minimum_amount": "string",
        "created_at": "2019-08-24T14:15:22Z",
        "updated_at": "2019-08-24T14:15:22Z",
        "deleted_at": "2019-08-24T14:15:22Z"
      }
    ],
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "deleted_at": "2019-08-24T14:15:22Z"
  }
}
{
  "message": "Unauthenticated."
}
{
  "message": "This action is unauthorized."
}
{
  "message": "Rule not found."
}
{
  "message": "The given data was invalid.",
  "errors": {
    "data": [
      "The data field is required."
    ]
  }
}
PUT
/v2/promotions/{promotion}

Authorization

bearerAuth storeAuth
AuthorizationBearer <token>

Provide your SellApp API key as a bearer token.

In: header

X-STORE<token>

Select the SellApp store for this API request.

In: header

Path Parameters

promotion*integer

The promotion path parameter.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://sell.app/api/v2/promotions/0" \  -H "Content-Type: application/json" \  -d '{    "name": "Extended launch",    "is_stackable": true  }'
{
  "data": {
    "id": 0,
    "name": "string",
    "status": "active",
    "starts_at": "2019-08-24T14:15:22Z",
    "ends_at": "2019-08-24T14:15:22Z",
    "priority": 0,
    "is_stackable": true,
    "max_redemptions": 1,
    "phases": [
      {
        "id": 0,
        "promotion_id": 0,
        "sort_order": 1,
        "discount_type": "percentage",
        "discount_value": "string",
        "ends_at": "2019-08-24T14:15:22Z",
        "max_redemptions": 1,
        "minimum_amount": "string",
        "created_at": "2019-08-24T14:15:22Z",
        "updated_at": "2019-08-24T14:15:22Z",
        "deleted_at": "2019-08-24T14:15:22Z"
      }
    ],
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "deleted_at": "2019-08-24T14:15:22Z"
  }
}
{
  "message": "Unauthenticated."
}
{
  "message": "This action is unauthorized."
}
{
  "message": "Rule not found."
}
{
  "message": "The given data was invalid.",
  "errors": {
    "data": [
      "The data field is required."
    ]
  }
}