{
  "info": {
    "name": "Passkaar integration API",
    "description": {
      "content": "A shop's own systems — its online store, its outlets' POS — read the shop's cards, sign customers up and give or spend loyalty value. Cards are made and edited in the Passkaar portal; an integration only uses them.\n\nEvery credential belongs to one connection of one shop. Send it as `Authorization: Bearer psk_live_…` (or `psk_test_…` on a test shop). A key works only under `/integrations/v1`. Every failed check of the key, its connection, the shop or the scope answers the same `401`.\n\nErrors are RFC 9457 Problem Details (`application/problem+json`) with a stable `code`. Branch on `code`; treat a code you do not know by its HTTP status, because new codes are an additive change.\n\nWithin v1 changes are additive only: new fields, new codes, new events. Ignore what you do not know. Lists take an opaque `cursor` and a `limit` of at most 100.\n\nMoney in a request is whole rupees. Events are Standard Webhooks, signed, ids and facts only.",
      "type": "text/plain"
    },
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "item": [
    {
      "name": "Programs",
      "description": "The shop's cards and branches.",
      "item": [
        {
          "name": "The shop's live cards",
          "request": {
            "name": "The shop's live cards",
            "description": {
              "content": "Scope: `programs:read`.",
              "type": "text/plain"
            },
            "url": {
              "path": [
                "programs"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [
                {
                  "key": "cursor",
                  "value": "",
                  "description": {
                    "content": "`next_cursor` from the previous page. Opaque.",
                    "type": "text/plain"
                  },
                  "disabled": true
                },
                {
                  "key": "limit",
                  "value": "25",
                  "description": {
                    "content": "At most 100.",
                    "type": "text/plain"
                  },
                  "disabled": false
                }
              ],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "GET"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const documented = [200,400,401,429,500,503];",
                  "const served = Number(pm.variables.get('servedThroughPhase') || Infinity);",
                  "if (51 > served) {",
                  "  pm.test('not served yet, so 404', () => pm.response.to.have.status(404));",
                  "} else {",
                  "  pm.test('answers a status the contract lists', () => pm.expect(documented).to.include(pm.response.code));",
                  "  pm.test('carries X-Request-Id', () => pm.response.to.have.header('X-Request-Id'));",
                  "  if (pm.response.code >= 400) {",
                  "    pm.test('a refusal is a Problem with a code', () => {",
                  "      pm.expect(pm.response.headers.get('Content-Type')).to.include('application/problem+json');",
                  "      pm.expect(pm.response.json().code).to.be.a('string');",
                  "    });",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "A card's type, rules, rewards and join form",
          "request": {
            "name": "A card's type, rules, rewards and join form",
            "description": {
              "content": "Scope: `programs:read`.",
              "type": "text/plain"
            },
            "url": {
              "path": [
                "programs",
                ":id"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "key": "id",
                  "value": "{{programId}}",
                  "description": {
                    "content": "(Required) ",
                    "type": "text/plain"
                  }
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "GET"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const documented = [200,400,401,404,429,500,503];",
                  "const served = Number(pm.variables.get('servedThroughPhase') || Infinity);",
                  "if (51 > served) {",
                  "  pm.test('not served yet, so 404', () => pm.response.to.have.status(404));",
                  "} else {",
                  "  pm.test('answers a status the contract lists', () => pm.expect(documented).to.include(pm.response.code));",
                  "  pm.test('carries X-Request-Id', () => pm.response.to.have.header('X-Request-Id'));",
                  "  if (pm.response.code >= 400) {",
                  "    pm.test('a refusal is a Problem with a code', () => {",
                  "      pm.expect(pm.response.headers.get('Content-Type')).to.include('application/problem+json');",
                  "      pm.expect(pm.response.json().code).to.be.a('string');",
                  "    });",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "The shop's branches",
          "request": {
            "name": "The shop's branches",
            "description": {
              "content": "Scope: `programs:read`.",
              "type": "text/plain"
            },
            "url": {
              "path": [
                "branches"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [
                {
                  "key": "cursor",
                  "value": "",
                  "description": {
                    "content": "`next_cursor` from the previous page. Opaque.",
                    "type": "text/plain"
                  },
                  "disabled": true
                },
                {
                  "key": "limit",
                  "value": "25",
                  "description": {
                    "content": "At most 100.",
                    "type": "text/plain"
                  },
                  "disabled": false
                }
              ],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "GET"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const documented = [200,400,401,429,500,503];",
                  "const served = Number(pm.variables.get('servedThroughPhase') || Infinity);",
                  "if (51 > served) {",
                  "  pm.test('not served yet, so 404', () => pm.response.to.have.status(404));",
                  "} else {",
                  "  pm.test('answers a status the contract lists', () => pm.expect(documented).to.include(pm.response.code));",
                  "  pm.test('carries X-Request-Id', () => pm.response.to.have.header('X-Request-Id'));",
                  "  if (pm.response.code >= 400) {",
                  "    pm.test('a refusal is a Problem with a code', () => {",
                  "      pm.expect(pm.response.headers.get('Content-Type')).to.include('application/problem+json');",
                  "      pm.expect(pm.response.json().code).to.be.a('string');",
                  "    });",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Customers",
      "description": "Signing customers up and linking them.",
      "item": [
        {
          "name": "Sign a customer up",
          "request": {
            "name": "Sign a customer up",
            "description": {
              "content": "Only on the customer’s own tap, never in bulk. Makes the customer and the card in one step and answers a claim link for the customer to add the card to their wallet. Earning starts at once. `already_member` answers a link only for a card this connection made.\n\nScope: `customers:enrol`.",
              "type": "text/plain"
            },
            "url": {
              "path": [
                "enrolments"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": {
                  "content": "Any 1–255 visible ASCII characters, a UUID by preference. A retry with the same key within 24 hours answers the first result. `reference` is what guards a resend after that.",
                  "type": "text/plain"
                }
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"program\": \"{{programId}}\",\n  \"answers\": {\n    \"first_name\": \"{{firstName}}\",\n    \"phone\": \"{{phone}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const documented = [200,201,400,401,403,404,409,422,429,500,503];",
                  "const served = Number(pm.variables.get('servedThroughPhase') || Infinity);",
                  "if (51 > served) {",
                  "  pm.test('not served yet, so 404', () => pm.response.to.have.status(404));",
                  "} else {",
                  "  pm.test('answers a status the contract lists', () => pm.expect(documented).to.include(pm.response.code));",
                  "  pm.test('carries X-Request-Id', () => pm.response.to.have.header('X-Request-Id'));",
                  "  if (pm.response.code >= 400) {",
                  "    pm.test('a refusal is a Problem with a code', () => {",
                  "      pm.expect(pm.response.headers.get('Content-Type')).to.include('application/problem+json');",
                  "      pm.expect(pm.response.json().code).to.be.a('string');",
                  "    });",
                  "  }",
                  "  if (pm.response.code < 300) {",
                  "    const made = pm.response.json();",
                  "    pm.collectionVariables.set('cardUuid', made.card.id);",
                  "    pm.collectionVariables.set('cardId', made.card.card_id);",
                  "    pm.collectionVariables.set('customerId', made.customer.id);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "A fresh claim link for a card never in a wallet",
          "request": {
            "name": "A fresh claim link for a card never in a wallet",
            "description": {
              "content": "Only for a card this connection’s own sign-up made, while it has never been in a wallet. A card answered `already_member` that another connection or the join page made takes none.\n\nScope: `customers:enrol`.",
              "type": "text/plain"
            },
            "url": {
              "path": [
                "cards",
                ":id",
                "claim-link"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "key": "id",
                  "value": "{{cardUuid}}",
                  "description": {
                    "content": "(Required) ",
                    "type": "text/plain"
                  }
                }
              ]
            },
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": {
                  "content": "Any 1–255 visible ASCII characters, a UUID by preference. A retry with the same key within 24 hours answers the first result. `reference` is what guards a resend after that.",
                  "type": "text/plain"
                }
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const documented = [201,400,401,403,404,409,422,429,500,503];",
                  "const served = Number(pm.variables.get('servedThroughPhase') || Infinity);",
                  "if (51 > served) {",
                  "  pm.test('not served yet, so 404', () => pm.response.to.have.status(404));",
                  "} else {",
                  "  pm.test('answers a status the contract lists', () => pm.expect(documented).to.include(pm.response.code));",
                  "  pm.test('carries X-Request-Id', () => pm.response.to.have.header('X-Request-Id'));",
                  "  if (pm.response.code >= 400) {",
                  "    pm.test('a refusal is a Problem with a code', () => {",
                  "      pm.expect(pm.response.headers.get('Content-Type')).to.include('application/problem+json');",
                  "      pm.expect(pm.response.json().code).to.be.a('string');",
                  "    });",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Attach or change the integration's customer id",
          "request": {
            "name": "Attach or change the integration's customer id",
            "description": {
              "content": "Scope: `customers:enrol`.",
              "type": "text/plain"
            },
            "url": {
              "path": [
                "customers",
                ":id",
                "external-id"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "key": "id",
                  "value": "{{customerId}}",
                  "description": {
                    "content": "(Required) ",
                    "type": "text/plain"
                  }
                }
              ]
            },
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"external_id\": \"{{externalId}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const documented = [200,400,401,403,404,409,429,500,503];",
                  "const served = Number(pm.variables.get('servedThroughPhase') || Infinity);",
                  "if (51 > served) {",
                  "  pm.test('not served yet, so 404', () => pm.response.to.have.status(404));",
                  "} else {",
                  "  pm.test('answers a status the contract lists', () => pm.expect(documented).to.include(pm.response.code));",
                  "  pm.test('carries X-Request-Id', () => pm.response.to.have.header('X-Request-Id'));",
                  "  if (pm.response.code >= 400) {",
                  "    pm.test('a refusal is a Problem with a code', () => {",
                  "      pm.expect(pm.response.headers.get('Content-Type')).to.include('application/problem+json');",
                  "      pm.expect(pm.response.json().code).to.be.a('string');",
                  "    });",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Link a card made at an outlet to a store account",
          "request": {
            "name": "Link a card made at an outlet to a store account",
            "description": {
              "content": "By the card ID printed on the card and the phone or email it was made with. The card is then proved to `external_id`, which may spend it (`POST /redemptions`, `POST /redemption-holds`); an id the customer already held from this connection is replaced and keeps no other proof. A mismatch answers 404, the same as a card that does not exist. Linking again answers the same.\n\nScope: `customers:enrol`.",
              "type": "text/plain"
            },
            "url": {
              "path": [
                "cards",
                "link"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": {
                  "content": "Any 1–255 visible ASCII characters, a UUID by preference. A retry with the same key within 24 hours answers the first result. `reference` is what guards a resend after that.",
                  "type": "text/plain"
                }
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"card_id\": \"{{cardId}}\",\n  \"phone\": \"{{phone}}\",\n  \"external_id\": \"{{externalId}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const documented = [200,400,401,403,404,409,422,429,500,503];",
                  "const served = Number(pm.variables.get('servedThroughPhase') || Infinity);",
                  "if (53 > served) {",
                  "  pm.test('not served yet, so 404', () => pm.response.to.have.status(404));",
                  "} else {",
                  "  pm.test('answers a status the contract lists', () => pm.expect(documented).to.include(pm.response.code));",
                  "  pm.test('carries X-Request-Id', () => pm.response.to.have.header('X-Request-Id'));",
                  "  if (pm.response.code >= 400) {",
                  "    pm.test('a refusal is a Problem with a code', () => {",
                  "      pm.expect(pm.response.headers.get('Content-Type')).to.include('application/problem+json');",
                  "      pm.expect(pm.response.json().code).to.be.a('string');",
                  "    });",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Cards",
      "description": "A customer's card and its history.",
      "item": [
        {
          "name": "Find a card by serial, card ID, phone, email or external id",
          "request": {
            "name": "Find a card by serial, card ID, phone, email or external id",
            "description": {
              "content": "A POST so a phone or email never sits in a URL or a log line.\n\nScope: `cards:read`.",
              "type": "text/plain"
            },
            "url": {
              "path": [
                "cards",
                "lookup"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"card_id\": \"{{cardId}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const documented = [200,400,401,404,409,429,500,503];",
                  "const served = Number(pm.variables.get('servedThroughPhase') || Infinity);",
                  "if (51 > served) {",
                  "  pm.test('not served yet, so 404', () => pm.response.to.have.status(404));",
                  "} else {",
                  "  pm.test('answers a status the contract lists', () => pm.expect(documented).to.include(pm.response.code));",
                  "  pm.test('carries X-Request-Id', () => pm.response.to.have.header('X-Request-Id'));",
                  "  if (pm.response.code >= 400) {",
                  "    pm.test('a refusal is a Problem with a code', () => {",
                  "      pm.expect(pm.response.headers.get('Content-Type')).to.include('application/problem+json');",
                  "      pm.expect(pm.response.json().code).to.be.a('string');",
                  "    });",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "A card's balance, rewards, tier, dates, status and whether it is in a wallet",
          "request": {
            "name": "A card's balance, rewards, tier, dates, status and whether it is in a wallet",
            "description": {
              "content": "Scope: `cards:read`.",
              "type": "text/plain"
            },
            "url": {
              "path": [
                "cards",
                ":id"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "key": "id",
                  "value": "{{cardUuid}}",
                  "description": {
                    "content": "(Required) ",
                    "type": "text/plain"
                  }
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "GET"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const documented = [200,400,401,404,429,500,503];",
                  "const served = Number(pm.variables.get('servedThroughPhase') || Infinity);",
                  "if (51 > served) {",
                  "  pm.test('not served yet, so 404', () => pm.response.to.have.status(404));",
                  "} else {",
                  "  pm.test('answers a status the contract lists', () => pm.expect(documented).to.include(pm.response.code));",
                  "  pm.test('carries X-Request-Id', () => pm.response.to.have.header('X-Request-Id'));",
                  "  if (pm.response.code >= 400) {",
                  "    pm.test('a refusal is a Problem with a code', () => {",
                  "      pm.expect(pm.response.headers.get('Content-Type')).to.include('application/problem+json');",
                  "      pm.expect(pm.response.json().code).to.be.a('string');",
                  "    });",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "A card's history",
          "request": {
            "name": "A card's history",
            "description": {
              "content": "Scope: `cards:read`.",
              "type": "text/plain"
            },
            "url": {
              "path": [
                "cards",
                ":id",
                "transactions"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [
                {
                  "key": "cursor",
                  "value": "",
                  "description": {
                    "content": "`next_cursor` from the previous page. Opaque.",
                    "type": "text/plain"
                  },
                  "disabled": true
                },
                {
                  "key": "limit",
                  "value": "25",
                  "description": {
                    "content": "At most 100.",
                    "type": "text/plain"
                  },
                  "disabled": false
                }
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{cardUuid}}",
                  "description": {
                    "content": "(Required) ",
                    "type": "text/plain"
                  }
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "GET"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const documented = [200,400,401,404,429,500,503];",
                  "const served = Number(pm.variables.get('servedThroughPhase') || Infinity);",
                  "if (51 > served) {",
                  "  pm.test('not served yet, so 404', () => pm.response.to.have.status(404));",
                  "} else {",
                  "  pm.test('answers a status the contract lists', () => pm.expect(documented).to.include(pm.response.code));",
                  "  pm.test('carries X-Request-Id', () => pm.response.to.have.header('X-Request-Id'));",
                  "  if (pm.response.code >= 400) {",
                  "    pm.test('a refusal is a Problem with a code', () => {",
                  "      pm.expect(pm.response.headers.get('Content-Type')).to.include('application/problem+json');",
                  "      pm.expect(pm.response.json().code).to.be.a('string');",
                  "    });",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Card actions",
      "description": "Giving, spending, reversing and holding value.",
      "item": [
        {
          "name": "Give value for a sale",
          "request": {
            "name": "Give value for a sale",
            "description": {
              "content": "The same `reference` again, at any age, answers the first result with `replayed: true`. A phone or email may name the card here: earning needs no card in hand. What one connection gives a card by count in a day is held to what its largest bill buys: one full card of stamps, or the points that bill would earn. A plan’s price times its quantity is held to the largest bill.\n\nScope: `awards:write`.",
              "type": "text/plain"
            },
            "url": {
              "path": [
                "awards"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": {
                  "content": "Any 1–255 visible ASCII characters, a UUID by preference. A retry with the same key within 24 hours answers the first result. `reference` is what guards a resend after that.",
                  "type": "text/plain"
                }
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"card\": {\n    \"card_id\": \"{{cardId}}\"\n  },\n  \"reference\": \"{{awardReference}}\",\n  \"give\": {\n    \"type\": \"stamps\",\n    \"stamps\": 1\n  },\n  \"note\": \"Sent from the Postman collection\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.collectionVariables.set('awardReference', 'PM-A-' + Date.now());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const documented = [200,201,400,401,404,409,422,429,500,503];",
                  "const served = Number(pm.variables.get('servedThroughPhase') || Infinity);",
                  "if (51 > served) {",
                  "  pm.test('not served yet, so 404', () => pm.response.to.have.status(404));",
                  "} else {",
                  "  pm.test('answers a status the contract lists', () => pm.expect(documented).to.include(pm.response.code));",
                  "  pm.test('carries X-Request-Id', () => pm.response.to.have.header('X-Request-Id'));",
                  "  if (pm.response.code >= 400) {",
                  "    pm.test('a refusal is a Problem with a code', () => {",
                  "      pm.expect(pm.response.headers.get('Content-Type')).to.include('application/problem+json');",
                  "      pm.expect(pm.response.json().code).to.be.a('string');",
                  "    });",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Refund or void an award, in full or in part",
          "request": {
            "name": "Refund or void an award, in full or in part",
            "description": {
              "content": "Full and unspent: the award is undone. Partial: its proportional share. Already spent: what is there is taken, never below zero, and `refund.unresolved` is sent.\n\nScope: `awards:reverse`.",
              "type": "text/plain"
            },
            "url": {
              "path": [
                "awards",
                ":reference",
                "reverse"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "key": "reference",
                  "value": "{{awardReference}}",
                  "description": {
                    "content": "(Required) The award's `reference`, percent-encoded as one path segment (`encodeURIComponent`): `INV/24-25/001` is sent as `INV%2F24-25%2F001`, and `%`, `?` and `#` are encoded the same way.",
                    "type": "text/plain"
                  }
                }
              ]
            },
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": {
                  "content": "Any 1–255 visible ASCII characters, a UUID by preference. A retry with the same key within 24 hours answers the first result. `reference` is what guards a resend after that.",
                  "type": "text/plain"
                }
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const documented = [200,201,400,401,404,409,422,429,500,503];",
                  "const served = Number(pm.variables.get('servedThroughPhase') || Infinity);",
                  "if (51 > served) {",
                  "  pm.test('not served yet, so 404', () => pm.response.to.have.status(404));",
                  "} else {",
                  "  pm.test('answers a status the contract lists', () => pm.expect(documented).to.include(pm.response.code));",
                  "  pm.test('carries X-Request-Id', () => pm.response.to.have.header('X-Request-Id'));",
                  "  if (pm.response.code >= 400) {",
                  "    pm.test('a refusal is a Problem with a code', () => {",
                  "      pm.expect(pm.response.headers.get('Content-Type')).to.include('application/problem+json');",
                  "      pm.expect(pm.response.json().code).to.be.a('string');",
                  "    });",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Spend value now",
          "request": {
            "name": "Spend value now",
            "description": {
              "content": "Only the card itself (`serial` or `card_id`), or an `external_id` linked with the card, may spend. A phone, an email, or an id linked from a phone or email alone answers `card_required`.\n\nScope: `redemptions:write`.",
              "type": "text/plain"
            },
            "url": {
              "path": [
                "redemptions"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": {
                  "content": "Any 1–255 visible ASCII characters, a UUID by preference. A retry with the same key within 24 hours answers the first result. `reference` is what guards a resend after that.",
                  "type": "text/plain"
                }
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"card\": {\n    \"card_id\": \"{{cardId}}\"\n  },\n  \"reference\": \"{{redemptionReference}}\",\n  \"spend\": {\n    \"type\": \"reward\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.collectionVariables.set('redemptionReference', 'PM-R-' + Date.now());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const documented = [200,201,400,401,404,409,422,429,500,503];",
                  "const served = Number(pm.variables.get('servedThroughPhase') || Infinity);",
                  "if (51 > served) {",
                  "  pm.test('not served yet, so 404', () => pm.response.to.have.status(404));",
                  "} else {",
                  "  pm.test('answers a status the contract lists', () => pm.expect(documented).to.include(pm.response.code));",
                  "  pm.test('carries X-Request-Id', () => pm.response.to.have.header('X-Request-Id'));",
                  "  if (pm.response.code >= 400) {",
                  "    pm.test('a refusal is a Problem with a code', () => {",
                  "      pm.expect(pm.response.headers.get('Content-Type')).to.include('application/problem+json');",
                  "      pm.expect(pm.response.json().code).to.be.a('string');",
                  "    });",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Reserve value against an online order",
          "request": {
            "name": "Reserve value against an online order",
            "description": {
              "content": "For a stamps card’s reward, a points card’s points or reward, or a prepaid card’s deduction, spent by the card itself or an `external_id` linked with it, as `POST /redemptions` is. What is held is out of reach of every other spend, the till’s included, until it is confirmed, released, or lapses 15 minutes after it was made. A hold that lapsed spends nothing.\n\nScope: `redemptions:write`.",
              "type": "text/plain"
            },
            "url": {
              "path": [
                "redemption-holds"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": {
                  "content": "Any 1–255 visible ASCII characters, a UUID by preference. A retry with the same key within 24 hours answers the first result. `reference` is what guards a resend after that.",
                  "type": "text/plain"
                }
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"card\": {\n    \"card_id\": \"{{cardId}}\"\n  },\n  \"reference\": \"{{holdReference}}\",\n  \"spend\": {\n    \"type\": \"reward\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.collectionVariables.set('holdReference', 'PM-H-' + Date.now());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const documented = [200,201,400,401,404,409,422,429,500,503];",
                  "const served = Number(pm.variables.get('servedThroughPhase') || Infinity);",
                  "if (53 > served) {",
                  "  pm.test('not served yet, so 404', () => pm.response.to.have.status(404));",
                  "} else {",
                  "  pm.test('answers a status the contract lists', () => pm.expect(documented).to.include(pm.response.code));",
                  "  pm.test('carries X-Request-Id', () => pm.response.to.have.header('X-Request-Id'));",
                  "  if (pm.response.code >= 400) {",
                  "    pm.test('a refusal is a Problem with a code', () => {",
                  "      pm.expect(pm.response.headers.get('Content-Type')).to.include('application/problem+json');",
                  "      pm.expect(pm.response.json().code).to.be.a('string');",
                  "    });",
                  "  }",
                  "  if (pm.response.code < 300) pm.collectionVariables.set('holdId', pm.response.json().id);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Spend what a hold reserved",
          "request": {
            "name": "Spend what a hold reserved",
            "description": {
              "content": "Writes the one redemption, under the hold’s reference. Confirming a confirmed hold answers it again with `replayed: true`; a released or lapsed one answers `hold_not_open`. Until it lapses, a card that has since lost value, to an expiry or a refund, answers `insufficient_balance`.\n\nScope: `redemptions:write`.",
              "type": "text/plain"
            },
            "url": {
              "path": [
                "redemption-holds",
                ":id",
                "confirm"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "key": "id",
                  "value": "{{holdId}}",
                  "description": {
                    "content": "(Required) ",
                    "type": "text/plain"
                  }
                }
              ]
            },
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": {
                  "content": "Any 1–255 visible ASCII characters, a UUID by preference. A retry with the same key within 24 hours answers the first result. `reference` is what guards a resend after that.",
                  "type": "text/plain"
                }
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const documented = [200,400,401,404,409,422,429,500,503];",
                  "const served = Number(pm.variables.get('servedThroughPhase') || Infinity);",
                  "if (53 > served) {",
                  "  pm.test('not served yet, so 404', () => pm.response.to.have.status(404));",
                  "} else {",
                  "  pm.test('answers a status the contract lists', () => pm.expect(documented).to.include(pm.response.code));",
                  "  pm.test('carries X-Request-Id', () => pm.response.to.have.header('X-Request-Id'));",
                  "  if (pm.response.code >= 400) {",
                  "    pm.test('a refusal is a Problem with a code', () => {",
                  "      pm.expect(pm.response.headers.get('Content-Type')).to.include('application/problem+json');",
                  "      pm.expect(pm.response.json().code).to.be.a('string');",
                  "    });",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Free what a hold reserved",
          "request": {
            "name": "Free what a hold reserved",
            "description": {
              "content": "Releasing a released hold answers it again with `replayed: true`; a confirmed or lapsed one answers `hold_not_open`.\n\nScope: `redemptions:write`.",
              "type": "text/plain"
            },
            "url": {
              "path": [
                "redemption-holds",
                ":id",
                "release"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "key": "id",
                  "value": "{{holdId}}",
                  "description": {
                    "content": "(Required) ",
                    "type": "text/plain"
                  }
                }
              ]
            },
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": {
                  "content": "Any 1–255 visible ASCII characters, a UUID by preference. A retry with the same key within 24 hours answers the first result. `reference` is what guards a resend after that.",
                  "type": "text/plain"
                }
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const documented = [200,400,401,404,409,422,429,500,503];",
                  "const served = Number(pm.variables.get('servedThroughPhase') || Infinity);",
                  "if (53 > served) {",
                  "  pm.test('not served yet, so 404', () => pm.response.to.have.status(404));",
                  "} else {",
                  "  pm.test('answers a status the contract lists', () => pm.expect(documented).to.include(pm.response.code));",
                  "  pm.test('carries X-Request-Id', () => pm.response.to.have.header('X-Request-Id'));",
                  "  if (pm.response.code >= 400) {",
                  "    pm.test('a refusal is a Problem with a code', () => {",
                  "      pm.expect(pm.response.headers.get('Content-Type')).to.include('application/problem+json');",
                  "      pm.expect(pm.response.json().code).to.be.a('string');",
                  "    });",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Events",
      "description": "Webhooks and the event feed.",
      "item": [
        {
          "name": "The event feed",
          "request": {
            "name": "The event feed",
            "description": {
              "content": "Every event, the same envelopes the webhooks carry, oldest first from the cursor.\n\nScope: `events:read`.",
              "type": "text/plain"
            },
            "url": {
              "path": [
                "events"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [
                {
                  "key": "cursor",
                  "value": "",
                  "description": {
                    "content": "`next_cursor` from the previous page. Opaque.",
                    "type": "text/plain"
                  },
                  "disabled": true
                },
                {
                  "key": "limit",
                  "value": "25",
                  "description": {
                    "content": "At most 100.",
                    "type": "text/plain"
                  },
                  "disabled": false
                },
                {
                  "key": "type",
                  "value": "",
                  "description": {
                    "content": " (This can only be one of card.created,card.claimed,card.removed_from_wallet,award.created,award.reversed,reward.unlocked,redemption.created,balance.expired,refund.unresolved,customer.erased,connection.revoked,webhook.test,hold.created,hold.confirmed,hold.released,hold.expired)",
                    "type": "text/plain"
                  },
                  "disabled": true
                }
              ],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "GET"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const documented = [200,400,401,429,500,503];",
                  "const served = Number(pm.variables.get('servedThroughPhase') || Infinity);",
                  "if (52 > served) {",
                  "  pm.test('not served yet, so 404', () => pm.response.to.have.status(404));",
                  "} else {",
                  "  pm.test('answers a status the contract lists', () => pm.expect(documented).to.include(pm.response.code));",
                  "  pm.test('carries X-Request-Id', () => pm.response.to.have.header('X-Request-Id'));",
                  "  if (pm.response.code >= 400) {",
                  "    pm.test('a refusal is a Problem with a code', () => {",
                  "      pm.expect(pm.response.headers.get('Content-Type')).to.include('application/problem+json');",
                  "      pm.expect(pm.response.json().code).to.be.a('string');",
                  "    });",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "This connection's webhook endpoints",
          "request": {
            "name": "This connection's webhook endpoints",
            "description": {
              "content": "Scope: `webhooks:manage`.",
              "type": "text/plain"
            },
            "url": {
              "path": [
                "webhook-endpoints"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [
                {
                  "key": "cursor",
                  "value": "",
                  "description": {
                    "content": "`next_cursor` from the previous page. Opaque.",
                    "type": "text/plain"
                  },
                  "disabled": true
                },
                {
                  "key": "limit",
                  "value": "25",
                  "description": {
                    "content": "At most 100.",
                    "type": "text/plain"
                  },
                  "disabled": false
                }
              ],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "GET"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const documented = [200,400,401,429,500,503];",
                  "const served = Number(pm.variables.get('servedThroughPhase') || Infinity);",
                  "if (52 > served) {",
                  "  pm.test('not served yet, so 404', () => pm.response.to.have.status(404));",
                  "} else {",
                  "  pm.test('answers a status the contract lists', () => pm.expect(documented).to.include(pm.response.code));",
                  "  pm.test('carries X-Request-Id', () => pm.response.to.have.header('X-Request-Id'));",
                  "  if (pm.response.code >= 400) {",
                  "    pm.test('a refusal is a Problem with a code', () => {",
                  "      pm.expect(pm.response.headers.get('Content-Type')).to.include('application/problem+json');",
                  "      pm.expect(pm.response.json().code).to.be.a('string');",
                  "    });",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Add a webhook endpoint",
          "request": {
            "name": "Add a webhook endpoint",
            "description": {
              "content": "Scope: `webhooks:manage`.",
              "type": "text/plain"
            },
            "url": {
              "path": [
                "webhook-endpoints"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": {
                  "content": "Any 1–255 visible ASCII characters, a UUID by preference. A retry with the same key within 24 hours answers the first result. `reference` is what guards a resend after that.",
                  "type": "text/plain"
                }
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"url\": \"https://example.com/passkaar-webhooks\",\n  \"events\": [\n    \"award.created\",\n    \"award.reversed\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const documented = [201,400,401,409,422,429,500,503];",
                  "const served = Number(pm.variables.get('servedThroughPhase') || Infinity);",
                  "if (52 > served) {",
                  "  pm.test('not served yet, so 404', () => pm.response.to.have.status(404));",
                  "} else {",
                  "  pm.test('answers a status the contract lists', () => pm.expect(documented).to.include(pm.response.code));",
                  "  pm.test('carries X-Request-Id', () => pm.response.to.have.header('X-Request-Id'));",
                  "  if (pm.response.code >= 400) {",
                  "    pm.test('a refusal is a Problem with a code', () => {",
                  "      pm.expect(pm.response.headers.get('Content-Type')).to.include('application/problem+json');",
                  "      pm.expect(pm.response.json().code).to.be.a('string');",
                  "    });",
                  "  }",
                  "  if (pm.response.code < 300) pm.collectionVariables.set('webhookEndpointId', pm.response.json().id);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "A webhook endpoint",
          "request": {
            "name": "A webhook endpoint",
            "description": {
              "content": "Scope: `webhooks:manage`.",
              "type": "text/plain"
            },
            "url": {
              "path": [
                "webhook-endpoints",
                ":id"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "key": "id",
                  "value": "{{webhookEndpointId}}",
                  "description": {
                    "content": "(Required) ",
                    "type": "text/plain"
                  }
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "GET"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const documented = [200,400,401,404,429,500,503];",
                  "const served = Number(pm.variables.get('servedThroughPhase') || Infinity);",
                  "if (52 > served) {",
                  "  pm.test('not served yet, so 404', () => pm.response.to.have.status(404));",
                  "} else {",
                  "  pm.test('answers a status the contract lists', () => pm.expect(documented).to.include(pm.response.code));",
                  "  pm.test('carries X-Request-Id', () => pm.response.to.have.header('X-Request-Id'));",
                  "  if (pm.response.code >= 400) {",
                  "    pm.test('a refusal is a Problem with a code', () => {",
                  "      pm.expect(pm.response.headers.get('Content-Type')).to.include('application/problem+json');",
                  "      pm.expect(pm.response.json().code).to.be.a('string');",
                  "    });",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Change, switch off or switch back on a webhook endpoint",
          "request": {
            "name": "Change, switch off or switch back on a webhook endpoint",
            "description": {
              "content": "Scope: `webhooks:manage`.",
              "type": "text/plain"
            },
            "url": {
              "path": [
                "webhook-endpoints",
                ":id"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "key": "id",
                  "value": "{{webhookEndpointId}}",
                  "description": {
                    "content": "(Required) ",
                    "type": "text/plain"
                  }
                }
              ]
            },
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "PATCH",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"events\": [\n    \"award.created\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const documented = [200,400,401,404,422,429,500,503];",
                  "const served = Number(pm.variables.get('servedThroughPhase') || Infinity);",
                  "if (52 > served) {",
                  "  pm.test('not served yet, so 404', () => pm.response.to.have.status(404));",
                  "} else {",
                  "  pm.test('answers a status the contract lists', () => pm.expect(documented).to.include(pm.response.code));",
                  "  pm.test('carries X-Request-Id', () => pm.response.to.have.header('X-Request-Id'));",
                  "  if (pm.response.code >= 400) {",
                  "    pm.test('a refusal is a Problem with a code', () => {",
                  "      pm.expect(pm.response.headers.get('Content-Type')).to.include('application/problem+json');",
                  "      pm.expect(pm.response.json().code).to.be.a('string');",
                  "    });",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Remove a webhook endpoint",
          "request": {
            "name": "Remove a webhook endpoint",
            "description": {
              "content": "Scope: `webhooks:manage`.",
              "type": "text/plain"
            },
            "url": {
              "path": [
                "webhook-endpoints",
                ":id"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "key": "id",
                  "value": "{{webhookEndpointId}}",
                  "description": {
                    "content": "(Required) ",
                    "type": "text/plain"
                  }
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/problem+json"
              }
            ],
            "method": "DELETE"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const documented = [204,400,401,404,429,500,503];",
                  "const served = Number(pm.variables.get('servedThroughPhase') || Infinity);",
                  "if (52 > served) {",
                  "  pm.test('not served yet, so 404', () => pm.response.to.have.status(404));",
                  "} else {",
                  "  pm.test('answers a status the contract lists', () => pm.expect(documented).to.include(pm.response.code));",
                  "  pm.test('carries X-Request-Id', () => pm.response.to.have.header('X-Request-Id'));",
                  "  if (pm.response.code >= 400) {",
                  "    pm.test('a refusal is a Problem with a code', () => {",
                  "      pm.expect(pm.response.headers.get('Content-Type')).to.include('application/problem+json');",
                  "      pm.expect(pm.response.json().code).to.be.a('string');",
                  "    });",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Send a `webhook.test` event to the endpoint",
          "request": {
            "name": "Send a `webhook.test` event to the endpoint",
            "description": {
              "content": "Scope: `webhooks:manage`.",
              "type": "text/plain"
            },
            "url": {
              "path": [
                "webhook-endpoints",
                ":id",
                "test"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "key": "id",
                  "value": "{{webhookEndpointId}}",
                  "description": {
                    "content": "(Required) ",
                    "type": "text/plain"
                  }
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const documented = [202,400,401,404,429,500,503];",
                  "const served = Number(pm.variables.get('servedThroughPhase') || Infinity);",
                  "if (52 > served) {",
                  "  pm.test('not served yet, so 404', () => pm.response.to.have.status(404));",
                  "} else {",
                  "  pm.test('answers a status the contract lists', () => pm.expect(documented).to.include(pm.response.code));",
                  "  pm.test('carries X-Request-Id', () => pm.response.to.have.header('X-Request-Id'));",
                  "  if (pm.response.code >= 400) {",
                  "    pm.test('a refusal is a Problem with a code', () => {",
                  "      pm.expect(pm.response.headers.get('Content-Type')).to.include('application/problem+json');",
                  "      pm.expect(pm.response.json().code).to.be.a('string');",
                  "    });",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Roll the endpoint's signing secret",
          "request": {
            "name": "Roll the endpoint's signing secret",
            "description": {
              "content": "Both secrets sign every delivery for the next 24 hours, and the endpoint takes no other roll until they end.\n\nScope: `webhooks:manage`.",
              "type": "text/plain"
            },
            "url": {
              "path": [
                "webhook-endpoints",
                ":id",
                "roll-secret"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "key": "id",
                  "value": "{{webhookEndpointId}}",
                  "description": {
                    "content": "(Required) ",
                    "type": "text/plain"
                  }
                }
              ]
            },
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": {
                  "content": "Any 1–255 visible ASCII characters, a UUID by preference. A retry with the same key within 24 hours answers the first result. `reference` is what guards a resend after that.",
                  "type": "text/plain"
                }
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const documented = [200,400,401,404,409,422,429,500,503];",
                  "const served = Number(pm.variables.get('servedThroughPhase') || Infinity);",
                  "if (52 > served) {",
                  "  pm.test('not served yet, so 404', () => pm.response.to.have.status(404));",
                  "} else {",
                  "  pm.test('answers a status the contract lists', () => pm.expect(documented).to.include(pm.response.code));",
                  "  pm.test('carries X-Request-Id', () => pm.response.to.have.header('X-Request-Id'));",
                  "  if (pm.response.code >= 400) {",
                  "    pm.test('a refusal is a Problem with a code', () => {",
                  "      pm.expect(pm.response.headers.get('Content-Type')).to.include('application/problem+json');",
                  "      pm.expect(pm.response.json().code).to.be.a('string');",
                  "    });",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Contract",
      "description": "This document.",
      "item": [
        {
          "name": "This contract",
          "request": {
            "name": "This contract",
            "description": {
              "content": "Public: no key. On `check:turnstile`’s written exemption list (ADR 0210).\n\nNo key needed.",
              "type": "text/plain"
            },
            "url": {
              "path": [
                "openapi.json"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/problem+json"
              }
            ],
            "method": "GET",
            "auth": {
              "type": "noauth"
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const documented = [200,429];",
                  "const served = Number(pm.variables.get('servedThroughPhase') || Infinity);",
                  "if (51 > served) {",
                  "  pm.test('not served yet, so 404', () => pm.response.to.have.status(404));",
                  "} else {",
                  "  pm.test('answers a status the contract lists', () => pm.expect(documented).to.include(pm.response.code));",
                  "  pm.test('carries X-Request-Id', () => pm.response.to.have.header('X-Request-Id'));",
                  "  if (pm.response.code >= 400) {",
                  "    pm.test('a refusal is a Problem with a code', () => {",
                  "      pm.expect(pm.response.headers.get('Content-Type')).to.include('application/problem+json');",
                  "      pm.expect(pm.response.json().code).to.be.a('string');",
                  "    });",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    }
  ],
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{bearerToken}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://api.passkaar.com/integrations/v1"
    },
    {
      "key": "servedThroughPhase",
      "value": ""
    }
  ]
}
