Reserve rules

Get reserve rule details

Retrieve the details of a specific reserve rule.

Path Parameters
  • entityId
    Type: string
    required

    The sub-entity's ID.

  • id
    Type: string
    required

    The reserve rule ID.

Responses
  • application/json
  • 400

    Bad Request

  • 401

    Unauthorized

Request Example for get/accounts/entities/{entityId}/reserve-rules/{id}
Shell Curl
curl 'https://{prefix}.api.sandbox.checkout.com/accounts/entities/ent_w4jelhppmfiufdnatam37wrfc4/reserve-rules/rsv_qn4nis4k3ykpzzu7cvtuvhqqga' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "id": "rsv_qn4nis4k3ykpzzu7cvtuvhqqga",
  "type": "rolling",
  "valid_from": "2001-01-01T13:33:00.000Z",
  "rolling": {
    "percentage": 10,
    "holding_duration": {
      "weeks": 2
    }
  }
}

Update reserve rule

Update an upcoming reserve rule. Only reserve rules that have never been active can be updated.

Path Parameters
  • entityId
    Type: string
    required

    The sub-entity's ID.

  • id
    Type: string
    required

    The reserve rule ID.

Headers
  • If-Match
    Type: string
    required

    Identifies a specific version of a reserve rule to update.

Body·
required
application/json
  • type
    enum
    const:  
    rolling
    required
    values
    • rolling
  • rolling
    Type: object ·
    required
Responses
  • application/json
  • 401

    Unauthorized

  • 412

    Precondition failed. An invalid ETag value was provided in the If-Match header.

  • application/json
  • application/json
Request Example for put/accounts/entities/{entityId}/reserve-rules/{id}
curl 'https://{prefix}.api.sandbox.checkout.com/accounts/entities/ent_w4jelhppmfiufdnatam37wrfc4/reserve-rules/rsv_qn4nis4k3ykpzzu7cvtuvhqqga' \
  --request PUT \
  --header 'If-Match: Y3Y9MCZydj0w' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "type": "rolling",
  "rolling": {
    "percentage": 10,
    "holding_duration": {
      "weeks": 2
    }
  }
}'
{
  "id": "rsv_qn4nis4k3ykpzzu7cvtuvhqqga",
  "_links": {
    "self": {
      "href": "string"
    }
  }
}

Add a reserve rule

Create a sub-entity reserve rule.

Path Parameters
  • id
    Type: string
    required

    The sub-entity's ID.

Body·
required
application/json

A JSON payload containing the reserve rule details.

  • Type: object · ReserveRuleCreateRequest
    • type
      enum
      const:  
      rolling
      required
      values
      • rolling
    • rolling
      Type: object ·
      required
    • valid_from
      Type: string Format: date-time
      required

      The date and time the reserve rule will come into effect. This must be at least 15 minutes in the future.

Responses
  • application/json
  • 400

    Bad Request

  • 401

    Unauthorized

  • application/json
Request Example for post/accounts/entities/{id}/reserve-rules
Shell Curl
curl 'https://{prefix}.api.sandbox.checkout.com/accounts/entities/ent_w4jelhppmfiufdnatam37wrfc4/reserve-rules' \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "type": "rolling",
  "valid_from": "2001-01-01T13:33:00.000Z",
  "rolling": {
    "percentage": 10,
    "holding_duration": {
      "weeks": 2
    }
  }
}'
{
  "id": "rsv_qn4nis4k3ykpzzu7cvtuvhqqga",
  "_links": {
    "self": {
      "href": "string"
    }
  }
}

Query reserve rules

Fetch all of the reserve rules for a sub-entity.

Path Parameters
  • id
    Type: string
    required

    The sub-entity's ID.

Responses
  • application/json
  • 400

    Bad Request

  • 401

    Unauthorized

Request Example for get/accounts/entities/{id}/reserve-rules
Shell Curl
curl 'https://{prefix}.api.sandbox.checkout.com/accounts/entities/ent_w4jelhppmfiufdnatam37wrfc4/reserve-rules' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "data": [
    {
      "id": "rsv_qn4nis4k3ykpzzu7cvtuvhqqga",
      "type": "rolling",
      "valid_from": "2001-01-01T13:33:00.000Z",
      "rolling": {
        "percentage": 10,
        "holding_duration": {
          "weeks": 2
        }
      }
    },
    {
      "id": "rsv_yk7nmh5jypmqzw5kb6kshj2iiy",
      "type": "rolling",
      "valid_from": "2001-02-01T13:33:00.000Z",
      "rolling": {
        "percentage": 15,
        "holding_duration": {
          "weeks": 4
        }
      }
    }
  ]
}