{"openapi":"3.1.0","info":{"title":"Ledger API","version":"2026-11-27","description":"Gift cards for locations and businesses.\n\n**Authentication**: `Authorization: Bearer <api key>`. Keys belong to one workspace and carry scopes.\n\n**Money**: amounts are strings of minor units (`\"15000\"` = €150.00) with an ISO 4217 currency.\n\n**Idempotency**: every money-moving POST requires an `Idempotency-Key` header.\n\n**Errors**: JSON bodies tagged with `_tag` (e.g. `InsufficientBalance`).\n\n**Rate limits**: per API key; `429` responses include `Retry-After`.\n\n**Versioning**: breaking changes ship under a new dated version; additive changes (new fields, endpoints, error tags) can appear at any time, so clients must ignore unknown fields.\n\n**Errors**:\n- `Unauthorized`: 401 — missing, invalid, expired or revoked API key.\n- `Forbidden`: 403 — the key lacks the required scope, or the location is outside its access.\n- `NotFound`: 404 — resource does not exist in this workspace (unknown and malformed codes look identical).\n- `ValidationFailed`: 422 — request is well-formed JSON but violates a business rule.\n- `CardNotUsable`: 422 — card is frozen, expired, cancelled, or not valid at this location/for these items.\n- `InsufficientBalance`: 422 — available balance (balance minus open holds) is lower than requested.\n- `IdempotencyConflict`: 409 — Idempotency-Key reused with a different body, or the first request is still running.\n- `HoldNotOpen`: 409 — hold was already captured, voided or expired.","contact":{"name":"Ledger API support","url":"https://app.jortkuhlmann.tech"},"x-error-catalogue":{"Unauthorized":"401 — missing, invalid, expired or revoked API key.","Forbidden":"403 — the key lacks the required scope, or the location is outside its access.","NotFound":"404 — resource does not exist in this workspace (unknown and malformed codes look identical).","ValidationFailed":"422 — request is well-formed JSON but violates a business rule.","CardNotUsable":"422 — card is frozen, expired, cancelled, or not valid at this location/for these items.","InsufficientBalance":"422 — available balance (balance minus open holds) is lower than requested.","IdempotencyConflict":"409 — Idempotency-Key reused with a different body, or the first request is still running.","HoldNotOpen":"409 — hold was already captured, voided or expired."}},"paths":{"/health":{"get":{"tags":["System"],"operationId":"system.health","parameters":[],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"],"additionalProperties":false}}}}},"summary":"Health check"}},"/v1/legal_entities":{"get":{"tags":["Organisation"],"operationId":"setup.listLegalEntities","parameters":[],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LegalEntity"}},"has_more":{"type":"boolean"}},"required":["data","has_more"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}}},"description":"Companies in the business. Each keeps its own books.","summary":"List legal entities"}},"/v1/locations":{"get":{"tags":["Organisation"],"operationId":"setup.listLocations","parameters":[],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Location"}},"has_more":{"type":"boolean"}},"required":["data","has_more"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}}},"description":"Locations in the workspace. `location_id` is required when redeeming.","summary":"List locations"}},"/v1/programs":{"get":{"tags":["Programs"],"operationId":"programs.list","parameters":[],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Program"}},"has_more":{"type":"boolean"}},"required":["data","has_more"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}}},"summary":"List programs"},"post":{"tags":["Programs"],"operationId":"programs.create","parameters":[],"security":[],"responses":{"200":{"description":"Program","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Program"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}},"422":{"description":"ValidationFailed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailedEncoded"}}}}},"description":"Defines where cards can be redeemed and on what. The voucher VAT class (single- or multi-purpose, EU Directive 2016/1065) is proposed from that scope; an SPV must cover one country and one VAT rate. Validity is checked against the strictest jurisdiction (IE: 60 months).","summary":"Create a program","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProgram"}}},"required":true}}},"/v1/gift_cards":{"get":{"tags":["Gift cards"],"operationId":"giftCards.list","parameters":[{"name":"status","in":"query","schema":{"type":"string","enum":["pending","active","frozen","redeemed","expired","cancelled"]},"required":false},{"name":"program_id","in":"query","schema":{"type":"string"},"required":false},{"name":"last4","in":"query","schema":{"type":"string"},"required":false},{"name":"cursor","in":"query","schema":{"type":"string"},"required":false},{"name":"limit","in":"query","schema":{"type":"string"},"required":false}],"security":[],"responses":{"200":{"description":"GiftCardPage","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCardPage"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}}},"description":"Newest first, cursor-paginated. Filter by status, program or last 4.","summary":"List gift cards"},"post":{"tags":["Gift cards"],"operationId":"giftCards.issue","parameters":[{"name":"idempotency-key","in":"header","schema":{"type":"string","minLength":4,"maxLength":255,"description":"Unique key per logical operation (e.g. a UUID). Retrying with the same key and body returns the original result; reusing it with a different body returns 409."},"required":true}],"security":[],"responses":{"200":{"description":"IssuedGiftCard","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssuedGiftCard"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}},"409":{"description":"IdempotencyConflict | ApprovalRequired","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/IdempotencyConflictEncoded"},{"$ref":"#/components/schemas/ApprovalRequiredEncoded"}]}}}},"422":{"description":"ValidationFailed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailedEncoded"}}}}},"description":"Creates an active card and returns the full code **once**. Ledger stores only a keyed hash of the code; it cannot be retrieved later.","summary":"Issue a gift card","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssueGiftCard"}}},"required":true},"x-idempotent":true}},"/v1/gift_cards/lookup":{"post":{"tags":["Gift cards"],"operationId":"giftCards.lookup","parameters":[],"security":[],"responses":{"200":{"description":"GiftCard","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCard"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}}},"description":"POST so codes never appear in URLs or logs. Unknown and malformed codes both return 404. Rate limited.","summary":"Look up a card by code","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LookupGiftCard"}}},"required":true}}},"/v1/gift_cards/{id}":{"get":{"tags":["Gift cards"],"operationId":"giftCards.get","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"security":[],"responses":{"200":{"description":"GiftCard","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCard"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}}},"summary":"Retrieve a card"}},"/v1/gift_cards/{id}/redeem":{"post":{"tags":["Gift cards"],"operationId":"giftCards.redeem","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true},{"name":"idempotency-key","in":"header","schema":{"type":"string","minLength":4,"maxLength":255,"description":"Unique key per logical operation (e.g. a UUID). Retrying with the same key and body returns the original result; reusing it with a different body returns 409."},"required":true}],"security":[],"responses":{"200":{"description":"Transaction","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Transaction"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}},"409":{"description":"IdempotencyConflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdempotencyConflictEncoded"}}}},"422":{"description":"CardNotUsable | InsufficientBalance | ValidationFailed","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/CardNotUsableEncoded"},{"$ref":"#/components/schemas/InsufficientBalanceEncoded"},{"$ref":"#/components/schemas/ValidationFailedEncoded"}]}}}}},"description":"Spends `amount` at a location. Pass `lines` with what was bought so multi-purpose vouchers book VAT at the right rate. For POS or booking flows, prefer holds.","summary":"Redeem (capture immediately)","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RedeemGiftCard"}}},"required":true},"x-idempotent":true}},"/v1/gift_cards/{id}/transactions":{"get":{"tags":["Gift cards"],"operationId":"giftCards.transactions","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GiftCardTransaction"}},"has_more":{"type":"boolean"}},"required":["data","has_more"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}}},"description":"Issue, top-ups, redemptions, refunds, expiry — oldest first.","summary":"List a card's transactions"}},"/v1/gift_cards/{id}/freeze":{"post":{"tags":["Gift cards"],"operationId":"giftCards.freeze","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"security":[],"responses":{"200":{"description":"GiftCard","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCard"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}},"422":{"description":"CardNotUsable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardNotUsableEncoded"}}}}},"description":"Blocks holds and redemptions until unfrozen (e.g. suspected fraud).","summary":"Freeze a card","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreezeGiftCard"}}},"required":true}}},"/v1/gift_cards/{id}/unfreeze":{"post":{"tags":["Gift cards"],"operationId":"giftCards.unfreeze","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"security":[],"responses":{"200":{"description":"GiftCard","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCard"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}},"422":{"description":"CardNotUsable | ValidationFailed","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/CardNotUsableEncoded"},{"$ref":"#/components/schemas/ValidationFailedEncoded"}]}}}}},"summary":"Unfreeze a card"}},"/v1/gift_cards/{id}/extend_expiry":{"post":{"tags":["Gift cards"],"operationId":"giftCards.extendExpiry","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"security":[],"responses":{"200":{"description":"GiftCard","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCard"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}},"422":{"description":"CardNotUsable | ValidationFailed","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/CardNotUsableEncoded"},{"$ref":"#/components/schemas/ValidationFailedEncoded"}]}}}}},"summary":"Extend a card's expiry","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtendExpiry"}}},"required":true}}},"/v1/gift_cards/{id}/top_up":{"post":{"tags":["Gift cards"],"operationId":"giftCards.topUp","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true},{"name":"idempotency-key","in":"header","schema":{"type":"string","minLength":4,"maxLength":255,"description":"Unique key per logical operation (e.g. a UUID). Retrying with the same key and body returns the original result; reusing it with a different body returns 409."},"required":true}],"security":[],"responses":{"200":{"description":"GiftCard","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCard"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}},"409":{"description":"IdempotencyConflict | ApprovalRequired","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/IdempotencyConflictEncoded"},{"$ref":"#/components/schemas/ApprovalRequiredEncoded"}]}}}},"422":{"description":"CardNotUsable | ValidationFailed","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/CardNotUsableEncoded"},{"$ref":"#/components/schemas/ValidationFailedEncoded"}]}}}}},"description":"Reloadable programs only. Single-purpose vouchers book VAT on the top-up.","summary":"Top up a card","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopUpGiftCard"}}},"required":true},"x-idempotent":true}},"/v1/gift_cards/{id}/refunds":{"post":{"tags":["Gift cards"],"operationId":"giftCards.refund","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true},{"name":"idempotency-key","in":"header","schema":{"type":"string","minLength":4,"maxLength":255,"description":"Unique key per logical operation (e.g. a UUID). Retrying with the same key and body returns the original result; reusing it with a different body returns 409."},"required":true}],"security":[],"responses":{"200":{"description":"GiftCard","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCard"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}},"409":{"description":"IdempotencyConflict | ApprovalRequired","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/IdempotencyConflictEncoded"},{"$ref":"#/components/schemas/ApprovalRequiredEncoded"}]}}}},"422":{"description":"CardNotUsable | ValidationFailed","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/CardNotUsableEncoded"},{"$ref":"#/components/schemas/ValidationFailedEncoded"}]}}}}},"description":"Exact reversal of the redemption's ledger entries, including VAT and inter-entity settlement.","summary":"Refund a redemption to the card","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundToCard"}}},"required":true},"x-idempotent":true}},"/v1/gift_cards/{id}/cancel":{"post":{"tags":["Gift cards"],"operationId":"giftCards.cancel","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true},{"name":"idempotency-key","in":"header","schema":{"type":"string","minLength":4,"maxLength":255,"description":"Unique key per logical operation (e.g. a UUID). Retrying with the same key and body returns the original result; reusing it with a different body returns 409."},"required":true}],"security":[],"responses":{"200":{"description":"GiftCard","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCard"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}},"409":{"description":"IdempotencyConflict | ApprovalRequired","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/IdempotencyConflictEncoded"},{"$ref":"#/components/schemas/ApprovalRequiredEncoded"}]}}}},"422":{"description":"CardNotUsable | ValidationFailed","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/CardNotUsableEncoded"},{"$ref":"#/components/schemas/ValidationFailedEncoded"}]}}}}},"description":"Terminal. Open holds are released.","summary":"Cancel a card","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelGiftCard"}}},"required":true},"x-idempotent":true}},"/v1/gift_cards/{id}/reissue":{"post":{"tags":["Gift cards"],"operationId":"giftCards.reissue","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true},{"name":"idempotency-key","in":"header","schema":{"type":"string","minLength":4,"maxLength":255,"description":"Unique key per logical operation (e.g. a UUID). Retrying with the same key and body returns the original result; reusing it with a different body returns 409."},"required":true}],"security":[],"responses":{"200":{"description":"ReissuedGiftCard","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReissuedGiftCard"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}},"409":{"description":"IdempotencyConflict | ApprovalRequired","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/IdempotencyConflictEncoded"},{"$ref":"#/components/schemas/ApprovalRequiredEncoded"}]}}}},"422":{"description":"CardNotUsable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardNotUsableEncoded"}}}}},"description":"Replaces a lost or compromised code: the balance moves to a new card (new code shown once); the old card is cancelled.","summary":"Reissue a card","requestBody":{"content":{"application/json":{"schema":{"not":{"type":"null"}}}},"required":true},"x-idempotent":true}},"/v1/holds":{"post":{"tags":["Holds"],"operationId":"holds.create","parameters":[{"name":"idempotency-key","in":"header","schema":{"type":"string","minLength":4,"maxLength":255,"description":"Unique key per logical operation (e.g. a UUID). Retrying with the same key and body returns the original result; reusing it with a different body returns 409."},"required":true}],"security":[],"responses":{"200":{"description":"Hold","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Hold"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}},"409":{"description":"IdempotencyConflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdempotencyConflictEncoded"}}}},"422":{"description":"CardNotUsable | InsufficientBalance","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/CardNotUsableEncoded"},{"$ref":"#/components/schemas/InsufficientBalanceEncoded"}]}}}}},"description":"Reserves balance for a booking or open folio. Holds expire after `ttl_seconds` (default 15 min) and are then released automatically.","summary":"Authorize (hold) an amount","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateHold"}}},"required":true},"x-idempotent":true}},"/v1/holds/{id}/capture":{"post":{"tags":["Holds"],"operationId":"holds.capture","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true},{"name":"idempotency-key","in":"header","schema":{"type":"string","minLength":4,"maxLength":255,"description":"Unique key per logical operation (e.g. a UUID). Retrying with the same key and body returns the original result; reusing it with a different body returns 409."},"required":true}],"security":[],"responses":{"200":{"description":"Transaction","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Transaction"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}},"409":{"description":"HoldNotOpen | IdempotencyConflict","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/HoldNotOpenEncoded"},{"$ref":"#/components/schemas/IdempotencyConflictEncoded"}]}}}},"422":{"description":"CardNotUsable | ValidationFailed","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/CardNotUsableEncoded"},{"$ref":"#/components/schemas/ValidationFailedEncoded"}]}}}}},"description":"Captures up to the held amount; any remainder is released.","summary":"Capture a hold","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaptureHold"}}},"required":true},"x-idempotent":true}},"/v1/holds/{id}/void":{"post":{"tags":["Holds"],"operationId":"holds.void","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"security":[],"responses":{"200":{"description":"Hold","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Hold"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}},"409":{"description":"HoldNotOpen","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HoldNotOpenEncoded"}}}}},"description":"Releases the full held amount.","summary":"Void a hold"}},"/v1/sandbox":{"get":{"tags":["Workspace security"],"operationId":"security.getSandbox","parameters":[],"security":[],"responses":{"200":{"description":"Sandbox","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sandbox"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}}},"description":"404 until one is created.","summary":"Get the test workspace"},"post":{"tags":["Workspace security"],"operationId":"security.createSandbox","parameters":[],"security":[],"responses":{"200":{"description":"Sandbox","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sandbox"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"422":{"description":"ValidationFailed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailedEncoded"}}}}},"description":"A linked sandbox with a copy of this workspace's setup (legal entities, locations, programs) — no cards, members or keys. Its API keys start with `lk_test_` and its webhooks carry `livemode: false`. Idempotent.","summary":"Create the test workspace"}},"/v1/approval_requests":{"get":{"tags":["Approvals"],"operationId":"approvals.list","parameters":[{"name":"status","in":"query","schema":{"type":"string","enum":["pending","executed","failed","rejected","expired"]},"required":false},{"name":"limit","in":"query","schema":{"type":"string"},"required":false}],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ApprovalRequest"}},"has_more":{"type":"boolean"}},"required":["data","has_more"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"422":{"description":"ValidationFailed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailedEncoded"}}}}},"description":"Newest first. Approvers see every request; everyone else sees their own.","summary":"List approval requests"}},"/v1/approval_requests/{id}":{"get":{"tags":["Approvals"],"operationId":"approvals.get","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"security":[],"responses":{"200":{"description":"ApprovalRequest","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalRequest"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}}},"summary":"Get an approval request"}},"/v1/approval_requests/{id}/approve":{"post":{"tags":["Approvals"],"operationId":"approvals.approve","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"security":[],"responses":{"200":{"description":"ApprovalRequest","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalRequest"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}},"422":{"description":"ValidationFailed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailedEncoded"}}}}},"description":"A different person than the requester, with the approval permission. The original request then runs as the requester, with its original idempotency key.","summary":"Approve a request","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecideApproval"}}},"required":true}}},"/v1/approval_requests/{id}/reject":{"post":{"tags":["Approvals"],"operationId":"approvals.reject","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"security":[],"responses":{"200":{"description":"ApprovalRequest","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalRequest"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}},"422":{"description":"ValidationFailed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailedEncoded"}}}}},"summary":"Reject a request","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecideApproval"}}},"required":true}}},"/v1/webhook_endpoints":{"get":{"tags":["Webhooks"],"operationId":"webhooks.list","parameters":[],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}},"has_more":{"type":"boolean"}},"required":["data","has_more"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}}},"summary":"List webhook endpoints"},"post":{"tags":["Webhooks"],"operationId":"webhooks.create","parameters":[],"security":[],"responses":{"200":{"description":"CreatedWebhookEndpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedWebhookEndpoint"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"422":{"description":"ValidationFailed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailedEncoded"}}}}},"description":"Events are POSTed as JSON `{ id, type, created_at, livemode, data }` with headers `Ledger-Event-Id` (stable across retries — dedupe on it), `Ledger-Delivery-Id` and `Ledger-Signature`. Non-2xx responses and timeouts (10 s) are retried with exponential backoff (8 attempts), then marked dead; redeliver from the deliveries list.","summary":"Create a webhook endpoint","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookEndpoint"}}},"required":true}}},"/v1/webhook_endpoints/{id}":{"patch":{"tags":["Webhooks"],"operationId":"webhooks.update","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"security":[],"responses":{"200":{"description":"WebhookEndpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}},"422":{"description":"ValidationFailed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailedEncoded"}}}}},"summary":"Update a webhook endpoint","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWebhookEndpoint"}}},"required":true}},"delete":{"tags":["Webhooks"],"operationId":"webhooks.remove","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}}},"summary":"Delete a webhook endpoint"}},"/v1/webhook_endpoints/{id}/rotate_secret":{"post":{"tags":["Webhooks"],"operationId":"webhooks.rotateSecret","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"security":[],"responses":{"200":{"description":"CreatedWebhookEndpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedWebhookEndpoint"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}}},"description":"The old secret stops working immediately.","summary":"Rotate the signing secret"}},"/v1/webhook_endpoints/{id}/deliveries":{"get":{"tags":["Webhooks"],"operationId":"webhooks.deliveries","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true},{"name":"limit","in":"query","schema":{"type":"string"},"required":false}],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}},"has_more":{"type":"boolean"}},"required":["data","has_more"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}}},"summary":"Recent deliveries"}},"/v1/webhook_endpoints/{id}/test":{"post":{"tags":["Webhooks"],"operationId":"webhooks.sendTest","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"security":[],"responses":{"200":{"description":"WebhookDelivery","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}}},"summary":"Send a webhook.test event"}},"/v1/webhook_endpoints/{id}/deliveries/{deliveryId}/redeliver":{"post":{"tags":["Webhooks"],"operationId":"webhooks.redeliver","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true},{"name":"deliveryId","in":"path","schema":{"type":"string"},"required":true}],"security":[],"responses":{"200":{"description":"WebhookDelivery","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}}},"description":"Same event id; attempts restart.","summary":"Redeliver an event"}},"/v1/bulk_issuances":{"get":{"tags":["Bulk issuance"],"operationId":"bulkIssuances.list","parameters":[],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/BulkIssuance"}},"has_more":{"type":"boolean"}},"required":["data","has_more"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}}},"summary":"List bulk issuances"},"post":{"tags":["Bulk issuance"],"operationId":"bulkIssuances.create","parameters":[{"name":"idempotency-key","in":"header","schema":{"type":"string","minLength":4,"maxLength":255,"description":"Unique key per logical operation (e.g. a UUID). Retrying with the same key and body returns the original result; reusing it with a different body returns 409."},"required":true}],"security":[],"responses":{"200":{"description":"BulkIssuance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkIssuance"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}},"409":{"description":"ApprovalRequired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalRequiredEncoded"}}}},"422":{"description":"ValidationFailed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailedEncoded"}}}}},"description":"Up to 10,000 cards, issued in the background (poll the batch for progress). Every row is validated before anything is issued. The total value counts toward four-eyes approval. Codes are delivered once, as an encrypted CSV only the requester can download, for 7 days.","summary":"Issue cards in bulk","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBulkIssuance"}}},"required":true},"x-idempotent":true}},"/v1/bulk_issuances/{id}":{"get":{"tags":["Bulk issuance"],"operationId":"bulkIssuances.get","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"security":[],"responses":{"200":{"description":"BulkIssuanceDetail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkIssuanceDetail"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}}},"description":"Progress and per-row errors.","summary":"Get a bulk issuance"}},"/v1/bulk_issuances/{id}/codes":{"get":{"tags":["Bulk issuance"],"operationId":"bulkIssuances.downloadCodes","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"security":[],"responses":{"200":{"description":"Success","content":{"text/csv":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}},"422":{"description":"ValidationFailed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailedEncoded"}}}}},"description":"Requester only. Every download is audited.","summary":"Download the codes (CSV)"},"delete":{"tags":["Bulk issuance"],"operationId":"bulkIssuances.purgeCodes","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"security":[],"responses":{"200":{"description":"BulkIssuance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkIssuance"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}}},"summary":"Delete the code file now"}},"/v1/risk_signals":{"get":{"tags":["Risk"],"operationId":"risk.listSignals","parameters":[{"name":"status","in":"query","schema":{"type":"string","enum":["open","resolved","dismissed"]},"required":false}],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RiskSignal"}},"has_more":{"type":"boolean"}},"required":["data","has_more"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}}},"description":"Velocity and anomaly findings, newest first. Also delivered as `risk.signal` webhook events.","summary":"List risk signals"}},"/v1/risk_signals/{id}/resolve":{"post":{"tags":["Risk"],"operationId":"risk.resolveSignal","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"security":[],"responses":{"200":{"description":"RiskSignal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RiskSignal"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}},"422":{"description":"ValidationFailed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailedEncoded"}}}}},"summary":"Resolve or dismiss a risk signal","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveRiskSignal"}}},"required":true}}},"/v1/overview":{"get":{"tags":["Risk"],"operationId":"risk.overview","parameters":[{"name":"days","in":"query","schema":{"type":"string"},"required":false}],"security":[],"responses":{"200":{"description":"Overview","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Overview"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"422":{"description":"ValidationFailed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailedEncoded"}}}}},"description":"Issued, redeemed, outstanding and breakage (face values, per currency) for the last `days` (default 30, max 366), with a daily series.","summary":"Overview"}},"/v1/risk_rules":{"get":{"tags":["Risk"],"operationId":"risk.getRules","parameters":[],"security":[],"responses":{"200":{"description":"RiskRules","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RiskRules"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}}},"summary":"Get the velocity and anomaly rules"},"patch":{"tags":["Risk"],"operationId":"risk.updateRules","parameters":[],"security":[],"responses":{"200":{"description":"RiskRules","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RiskRules"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"422":{"description":"ValidationFailed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailedEncoded"}}}}},"summary":"Update the velocity and anomaly rules","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRiskRules"}}},"required":true}}},"/v1/reports/datasets":{"get":{"tags":["Reports"],"operationId":"reports.datasets","parameters":[],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ReportDataset"}},"has_more":{"type":"boolean"}},"required":["data","has_more"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}}},"description":"Certified, versioned queries on the ledger. Numbers in reports come only from these.","summary":"List report datasets"}},"/v1/reports/runs":{"get":{"tags":["Reports"],"operationId":"reports.listRuns","parameters":[{"name":"limit","in":"query","schema":{"type":"string"},"required":false}],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ReportRun"}},"has_more":{"type":"boolean"}},"required":["data","has_more"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}}},"description":"Newest first.","summary":"List report runs"},"post":{"tags":["Reports"],"operationId":"reports.createRun","parameters":[],"security":[],"responses":{"200":{"description":"ReportRun","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportRun"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}},"422":{"description":"ValidationFailed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailedEncoded"}}}}},"description":"Runs a dataset for a period or point in time and stores CSV/Excel files. Reproducible: the run records the ledger position it used.","summary":"Run a report","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunReport"}}},"required":true}}},"/v1/reports/runs/{id}":{"get":{"tags":["Reports"],"operationId":"reports.getRun","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"security":[],"responses":{"200":{"description":"ReportRun","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportRun"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}}},"summary":"Retrieve a report run"}},"/v1/reports/artifacts/{id}/download":{"get":{"tags":["Reports"],"operationId":"reports.downloadArtifact","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"security":[],"responses":{"200":{"description":"Success","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}}},"description":"CSV or Excel. Every download is audited.","summary":"Download a report file"}},"/v1/reports/schedules":{"get":{"tags":["Reports"],"operationId":"reports.listSchedules","parameters":[],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ReportSchedule"}},"has_more":{"type":"boolean"}},"required":["data","has_more"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}}},"summary":"List report schedules"},"post":{"tags":["Reports"],"operationId":"reports.createSchedule","parameters":[],"security":[],"responses":{"200":{"description":"ReportSchedule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportSchedule"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}},"422":{"description":"ValidationFailed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailedEncoded"}}}}},"description":"Runs a dataset on a recurrence in the workspace time zone and emails it. Runs as its owner, with the owner's current permissions; pauses if they lose access.","summary":"Schedule a report","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateReportSchedule"}}},"required":true}}},"/v1/reports/schedules/{id}":{"patch":{"tags":["Reports"],"operationId":"reports.updateSchedule","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"security":[],"responses":{"200":{"description":"ReportSchedule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportSchedule"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}},"422":{"description":"ValidationFailed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailedEncoded"}}}}},"summary":"Pause, resume or change recipients","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateReportSchedule"}}},"required":true}},"delete":{"tags":["Reports"],"operationId":"reports.deleteSchedule","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}}},"summary":"Delete a schedule"}},"/v1/reports/schedules/{id}/run":{"post":{"tags":["Reports"],"operationId":"reports.runScheduleNow","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"security":[],"responses":{"200":{"description":"ScheduleRunResult","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleRunResult"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"404":{"description":"NotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundEncoded"}}}},"422":{"description":"ValidationFailed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailedEncoded"}}}}},"description":"Runs and delivers immediately for the most recent complete period.","summary":"Run a schedule now"}},"/v1/reports/gl_mapping":{"get":{"tags":["Reports"],"operationId":"reports.getGlMapping","parameters":[],"security":[],"responses":{"200":{"description":"Keys, most specific first: \"revenue:NL:900\" (kind:vat country:rate in basis points), \"card_liability:IE\" (kind:entity country), \"vat_payable\" (kind). Tax codes: \"tax:IE:1350\". Package settings: \"journal:exact\", \"journal:twinfield\", \"company:NL\" (SAP), \"subsidiary:IE\" (NetSuite). Kinds: card_liability, cash_clearing, revenue, vat_payable, breakage_income, promo_expense, inter_entity, network_fee, rounding, receivable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlMapping"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}}},"description":"How Ledger's accounts map to your general ledger in the journal exports.","summary":"Get the GL mapping"},"put":{"tags":["Reports"],"operationId":"reports.updateGlMapping","parameters":[],"security":[],"responses":{"200":{"description":"Keys, most specific first: \"revenue:NL:900\" (kind:vat country:rate in basis points), \"card_liability:IE\" (kind:entity country), \"vat_payable\" (kind). Tax codes: \"tax:IE:1350\". Package settings: \"journal:exact\", \"journal:twinfield\", \"company:NL\" (SAP), \"subsidiary:IE\" (NetSuite). Kinds: card_liability, cash_clearing, revenue, vat_payable, breakage_income, promo_expense, inter_entity, network_fee, rounding, receivable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlMapping"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenEncoded"}}}},"422":{"description":"ValidationFailed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailedEncoded"}}}}},"summary":"Replace the GL mapping","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlMapping"}}},"required":true}}}},"components":{"schemas":{"ForbiddenEncoded":{"type":"object","properties":{"_tag":{"type":"string","enum":["Forbidden"]},"message":{"type":"string"}},"required":["_tag","message"],"additionalProperties":false},"UnauthorizedEncoded":{"type":"object","properties":{"_tag":{"type":"string","enum":["Unauthorized"]},"message":{"type":"string"}},"required":["_tag","message"],"additionalProperties":false},"NotFoundEncoded":{"type":"object","properties":{"_tag":{"type":"string","enum":["NotFound"]},"resource":{"type":"string"},"id":{"type":"string"}},"required":["_tag","resource","id"],"additionalProperties":false},"ValidationFailedEncoded":{"type":"object","properties":{"_tag":{"type":"string","enum":["ValidationFailed"]},"message":{"type":"string"}},"required":["_tag","message"],"additionalProperties":false},"Money":{"type":"object","properties":{"amount":{"type":"string"},"currency":{"type":"string"}},"required":["amount","currency"],"additionalProperties":false},"ReportRun":{"type":"object","properties":{"id":{"type":"string"},"dataset_id":{"type":"string"},"title":{"type":"string"},"status":{"type":"string"},"params":{"type":"object","additionalProperties":{"type":"string"}},"as_of":{"type":"string"},"row_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"columns":{"type":"array","items":{"$ref":"#/components/schemas/ReportColumn"}},"preview_rows":{"type":"array","items":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"string","enum":["Infinity","-Infinity","NaN"]},{"type":"null"}]}}},"totals":{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"currency":{"type":"string"},"amount":{"type":"string"}},"required":["column","currency","amount"],"additionalProperties":false}},"artifacts":{"type":"array","items":{"$ref":"#/components/schemas/ReportArtifact"}},"created_at":{"type":"string"}},"required":["id","dataset_id","title","status","params","as_of","row_count","columns","preview_rows","totals","artifacts","created_at"],"additionalProperties":false},"ReportArtifact":{"type":"object","properties":{"id":{"type":"string"},"format":{"type":"string"},"file_name":{"type":"string"},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sha256":{"type":"string"},"download_url":{"type":"string"}},"required":["id","format","file_name","bytes","sha256","download_url"],"additionalProperties":false},"ReportColumn":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["text","int","money","percent","date"]}},"required":["key","label","type"],"additionalProperties":false},"GlMapping":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":64},"description":"Keys, most specific first: \"revenue:NL:900\" (kind:vat country:rate in basis points), \"card_liability:IE\" (kind:entity country), \"vat_payable\" (kind). Tax codes: \"tax:IE:1350\". Package settings: \"journal:exact\", \"journal:twinfield\", \"company:NL\" (SAP), \"subsidiary:IE\" (NetSuite). Kinds: card_liability, cash_clearing, revenue, vat_payable, breakage_income, promo_expense, inter_entity, network_fee, rounding, receivable.","examples":[{"card_liability":"2400","cash_clearing":"1100","revenue:NL:900":"8010","tax:NL:900":"2"}]},"ScheduleRunResult":{"type":"object","properties":{"run":{"$ref":"#/components/schemas/ReportRun"},"delivered_to":{"type":"array","items":{"type":"string"}}},"required":["run","delivered_to"],"additionalProperties":false},"ReportSchedule":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"dataset_id":{"type":"string"},"recurrence":{"$ref":"#/components/schemas/Recurrence"},"description":{"type":"string"},"period_rule":{"type":"string","enum":["previous_day","previous_week","previous_month","previous_quarter","as_of_run"],"description":"Which period each run covers. Use as_of_run for point-in-time datasets (liability, open cards)."},"formats":{"type":"array","items":{"type":"string","enum":["csv","xlsx"]}},"recipients":{"type":"array","items":{"type":"string"}},"delivery":{"type":"string","enum":["link","attachment","both"]},"enabled":{"type":"boolean"},"paused_reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"next_run_at":{"type":"string"},"last_run_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"owner_user_id":{"type":"string"}},"required":["id","title","dataset_id","recurrence","description","period_rule","formats","recipients","delivery","enabled","paused_reason","next_run_at","last_run_at","owner_user_id"],"additionalProperties":false},"Recurrence":{"type":"object","properties":{"frequency":{"type":"string","enum":["daily","weekly","monthly"]},"weekday":{"anyOf":[{"type":"integer","minimum":1,"maximum":7,"description":"weekly: 1 = Monday … 7 = Sunday"},{"type":"null"}]},"day_of_month":{"anyOf":[{"type":"integer","minimum":1,"maximum":28,"description":"monthly: 1–28"},{"type":"null"}]},"hour":{"type":"integer","minimum":0,"maximum":23},"minute":{"type":"integer","minimum":0,"maximum":59},"timezone":{"type":"string","description":"IANA zone, e.g. Europe/Dublin"}},"required":["frequency","hour","minute","timezone"],"additionalProperties":false},"UpdateReportSchedule":{"type":"object","properties":{"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"recipients":{"anyOf":[{"type":"array","prefixItems":[{"type":"string"}],"minItems":1,"items":{"type":"string"}},{"type":"null"}]}},"additionalProperties":false},"CreateReportSchedule":{"type":"object","properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"dataset_id":{"type":"string"},"recurrence":{"$ref":"#/components/schemas/Recurrence"},"period_rule":{"type":"string","enum":["previous_day","previous_week","previous_month","previous_quarter","as_of_run"],"description":"Which period each run covers. Use as_of_run for point-in-time datasets (liability, open cards)."},"formats":{"anyOf":[{"type":"array","items":{"type":"string","enum":["csv","xlsx"]}},{"type":"null"}]},"recipients":{"type":"array","prefixItems":[{"type":"string"}],"minItems":1,"items":{"type":"string"},"description":"Workspace members or approved external recipients (e.g. your accountant)."},"delivery":{"anyOf":[{"type":"string","enum":["link","attachment","both"]},{"type":"null"}]}},"required":["dataset_id","recurrence","period_rule","recipients"],"additionalProperties":false},"RunReport":{"type":"object","properties":{"dataset_id":{"type":"string"},"period_start":{"anyOf":[{"type":"string","description":"Inclusive, ISO date e.g. 2026-10-01"},{"type":"null"}]},"period_end":{"anyOf":[{"type":"string","description":"Exclusive, ISO date e.g. 2026-11-01"},{"type":"null"}]},"as_of":{"anyOf":[{"type":"string","description":"ISO date-time; defaults to now"},{"type":"null"}]},"formats":{"anyOf":[{"type":"array","items":{"type":"string","enum":["csv","xlsx"]}},{"type":"null"}]}},"required":["dataset_id"],"additionalProperties":false},"ReportDataset":{"type":"object","properties":{"id":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"title":{"type":"string"},"description":{"type":"string"},"params":{"type":"string","enum":["period","as_of"],"description":"period: needs period_start + period_end. as_of: a point in time (defaults to now)."},"columns":{"type":"array","items":{"$ref":"#/components/schemas/ReportColumn"}}},"required":["id","version","title","description","params","columns"],"additionalProperties":false},"RiskRules":{"type":"object","properties":{"redemptions_per_card_per_hour":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"auto_freeze":{"type":"boolean"},"drained_within_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"large_redemption":{"type":"object","additionalProperties":{"type":"string"}},"issued_per_actor_per_day":{"type":"object","additionalProperties":{"type":"string"}}},"required":["redemptions_per_card_per_hour","auto_freeze","drained_within_minutes","large_redemption","issued_per_actor_per_day"],"additionalProperties":false},"UpdateRiskRules":{"type":"object","properties":{"redemptions_per_card_per_hour":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"auto_freeze":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"drained_within_minutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"large_redemption":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]},"issued_per_actor_per_day":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"additionalProperties":false},"Overview":{"type":"object","properties":{"days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period_start":{"type":"string"},"period_end":{"type":"string"},"currencies":{"type":"array","items":{"$ref":"#/components/schemas/CurrencyOverview"}},"open_risk_signals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"pending_approvals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["days","period_start","period_end","currencies","open_risk_signals","pending_approvals"],"additionalProperties":false},"CurrencyOverview":{"type":"object","properties":{"currency":{"type":"string"},"issued":{"$ref":"#/components/schemas/Money"},"issued_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"loaded":{"$ref":"#/components/schemas/Money"},"redeemed":{"$ref":"#/components/schemas/Money"},"redeemed_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refunded_to_card":{"$ref":"#/components/schemas/Money"},"breakage":{"$ref":"#/components/schemas/Money"},"outstanding":{"$ref":"#/components/schemas/Money_2"},"outstanding_cards":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"daily":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"issued":{"type":"string"},"redeemed":{"type":"string"}},"required":["day","issued","redeemed"],"additionalProperties":false}}},"required":["currency","issued","issued_count","loaded","redeemed","redeemed_count","refunded_to_card","breakage","outstanding","outstanding_cards","daily"],"additionalProperties":false},"Money_2":{"type":"object","properties":{"amount":{"type":"string"},"currency":{"type":"string"}},"required":["amount","currency"],"additionalProperties":false,"description":"Face value still on active and frozen cards (now)"},"RiskSignal":{"type":"object","properties":{"id":{"type":"string"},"rule":{"type":"string"},"severity":{"type":"string","enum":["low","medium","high"]},"status":{"type":"string","enum":["open","resolved","dismissed"]},"summary":{"type":"string"},"details":{},"action":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"What was done automatically, e.g. \"card_frozen\""},"gift_card_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"resolved_by":{"anyOf":[{"type":"string"},{"type":"null"}]},"resolved_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string"}},"required":["id","rule","severity","status","summary","details","action","gift_card_id","actor_id","note","resolved_by","resolved_at","created_at"],"additionalProperties":false},"ResolveRiskSignal":{"type":"object","properties":{"status":{"type":"string","enum":["resolved","dismissed"]},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["status"],"additionalProperties":false},"BulkIssuance":{"type":"object","properties":{"id":{"type":"string"},"program_id":{"type":"string"},"reference":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["pending","processing","completed"]},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"issued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_value":{"$ref":"#/components/schemas/Money"},"codes_available":{"type":"boolean","description":"true for the requester while the encrypted code file exists"},"codes_expire_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"requested_by":{"type":"object","properties":{"type":{"type":"string"},"id":{"type":"string"}},"required":["type","id"],"additionalProperties":false},"created_at":{"type":"string"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","program_id","reference","status","total","issued","failed","total_value","codes_available","codes_expire_at","requested_by","created_at","completed_at"],"additionalProperties":false},"BulkIssuanceDetail":{"type":"object","properties":{"id":{"type":"string"},"program_id":{"type":"string"},"reference":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["pending","processing","completed"]},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"issued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_value":{"$ref":"#/components/schemas/Money"},"codes_available":{"type":"boolean","description":"true for the requester while the encrypted code file exists"},"codes_expire_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"requested_by":{"type":"object","properties":{"type":{"type":"string"},"id":{"type":"string"}},"required":["type","id"],"additionalProperties":false},"created_at":{"type":"string"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"errors":{"type":"array","items":{"type":"object","properties":{"row":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error":{"type":"string"}},"required":["row","error"],"additionalProperties":false}}},"required":["id","program_id","reference","status","total","issued","failed","total_value","codes_available","codes_expire_at","requested_by","created_at","completed_at","errors"],"additionalProperties":false},"ApprovalRequiredEncoded":{"type":"object","properties":{"_tag":{"type":"string","enum":["ApprovalRequired"]},"message":{"type":"string"},"approval_request_id":{"type":"string"},"status":{"type":"string"}},"required":["_tag","message","approval_request_id","status"],"additionalProperties":false},"CreateBulkIssuance":{"type":"object","properties":{"program_id":{"type":"string"},"reference":{"anyOf":[{"type":"string","maxLength":100,"description":"e.g. a purchase order number"},{"type":"null"}]},"items":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"amount":{"type":"string"},"reference":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["amount"],"additionalProperties":false},"description":"One entry per card (max 10,000). Or use count + amount."},{"type":"null"}]},"count":{"anyOf":[{"type":"integer","minimum":1,"maximum":10000},{"type":"null"}]},"amount":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["program_id"],"additionalProperties":false},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string"},"event_id":{"type":"string"},"event_type":{"type":"string"},"status":{"type":"string","enum":["pending","succeeded","failed","dead"]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"response_status":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}]},"delivered_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string"}},"required":["id","event_id","event_type","status","attempts","response_status","last_error","delivered_at","created_at"],"additionalProperties":false},"CreatedWebhookEndpoint":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"events":{"type":"array","items":{"type":"string"},"description":"Subscribed event types; empty = all"},"enabled":{"type":"boolean"},"created_at":{"type":"string"},"secret":{"type":"string","description":"Signing secret (whsec_…), shown once. Verify `Ledger-Signature: t=<unix>,v1=<hex HMAC-SHA256(secret, \"<t>.<raw body>\")>` and reject timestamps older than 5 minutes."}},"required":["id","url","description","events","enabled","created_at","secret"],"additionalProperties":false},"WebhookEndpoint":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"events":{"type":"array","items":{"type":"string"},"description":"Subscribed event types; empty = all"},"enabled":{"type":"boolean"},"created_at":{"type":"string"}},"required":["id","url","description","events","enabled","created_at"],"additionalProperties":false},"UpdateWebhookEndpoint":{"type":"object","properties":{"url":{"anyOf":[{"type":"string"},{"type":"null"}]},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"events":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"additionalProperties":false},"CreateWebhookEndpoint":{"type":"object","properties":{"url":{"type":"string","description":"Public https URL"},"description":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"events":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["url"],"additionalProperties":false},"ApprovalRequest":{"type":"object","properties":{"id":{"type":"string"},"operation_id":{"type":"string"},"summary":{"type":"string"},"amount":{"$ref":"#/components/schemas/Money"},"status":{"type":"string","enum":["pending","executed","failed","rejected","expired"]},"requested_by":{"type":"object","properties":{"type":{"type":"string"},"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["type","id","name"],"additionalProperties":false},"ai_assisted":{"type":"boolean"},"decided_by":{"anyOf":[{"type":"string"},{"type":"null"}]},"decided_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"result_status":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"result":{"anyOf":[{},{"type":"null"}]},"request":{"anyOf":[{"type":"object","properties":{"method":{"type":"string"},"path":{"type":"string"},"body":{},"idempotency_key":{"type":"string"}},"required":["method","path","body","idempotency_key"],"additionalProperties":false},{"type":"null"}]},"created_at":{"type":"string"},"expires_at":{"type":"string"}},"required":["id","operation_id","summary","amount","status","requested_by","ai_assisted","decided_by","decided_at","note","result_status","result","request","created_at","expires_at"],"additionalProperties":false},"DecideApproval":{"type":"object","properties":{"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"additionalProperties":false},"Sandbox":{"type":"object","properties":{"workspace_id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"production_workspace_id":{"type":"string"}},"required":["workspace_id","slug","name","production_workspace_id"],"additionalProperties":false},"HoldNotOpenEncoded":{"type":"object","properties":{"_tag":{"type":"string","enum":["HoldNotOpen"]},"status":{"type":"string"}},"required":["_tag","status"],"additionalProperties":false},"Hold":{"type":"object","properties":{"id":{"type":"string"},"gift_card_id":{"type":"string"},"location_id":{"type":"string"},"amount":{"$ref":"#/components/schemas/Money"},"captured":{"$ref":"#/components/schemas/Money"},"status":{"type":"string","enum":["open","captured","voided","expired"]},"expires_at":{"type":"string"}},"required":["id","gift_card_id","location_id","amount","captured","status","expires_at"],"additionalProperties":false},"CardNotUsableEncoded":{"type":"object","properties":{"_tag":{"type":"string","enum":["CardNotUsable"]},"reason":{"type":"string","enum":["not_active","frozen","expired","cancelled","currency_mismatch","not_redeemable_at_location","spv_scope_violation"]}},"required":["_tag","reason"],"additionalProperties":false},"IdempotencyConflictEncoded":{"type":"object","properties":{"_tag":{"type":"string","enum":["IdempotencyConflict"]},"message":{"type":"string"}},"required":["_tag","message"],"additionalProperties":false},"Transaction":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"gift_card_id":{"type":"string"},"amount":{"$ref":"#/components/schemas/Money"},"balance_after":{"$ref":"#/components/schemas/Money"},"effective_at":{"type":"string"}},"required":["id","type","gift_card_id","amount","balance_after","effective_at"],"additionalProperties":false},"CaptureHold":{"type":"object","properties":{"amount":{"anyOf":[{"type":"string"},{"type":"null"}]},"lines":{"anyOf":[{"type":"array","prefixItems":[{"$ref":"#/components/schemas/VatLineInput"}],"minItems":1,"items":{"$ref":"#/components/schemas/VatLineInput"}},{"type":"null"}]}},"additionalProperties":false},"VatLineInput":{"type":"object","properties":{"category":{"type":"string","enum":["accommodation","food_beverage","spa","other"]},"amount":{"type":"string"}},"required":["category","amount"],"additionalProperties":false},"InsufficientBalanceEncoded":{"type":"object","properties":{"_tag":{"type":"string","enum":["InsufficientBalance"]},"available":{"type":"string"},"requested":{"type":"string"},"currency":{"type":"string"}},"required":["_tag","available","requested","currency"],"additionalProperties":false},"CreateHold":{"type":"object","properties":{"gift_card_id":{"type":"string"},"amount":{"type":"string"},"location_id":{"type":"string"},"ttl_seconds":{"anyOf":[{"type":"integer","minimum":60,"maximum":2592000},{"type":"null"}]},"channel":{"anyOf":[{"type":"string"},{"type":"null"}]},"external_ref":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["gift_card_id","amount","location_id"],"additionalProperties":false},"ReissuedGiftCard":{"type":"object","properties":{"id":{"type":"string"},"program_id":{"type":"string"},"status":{"type":"string","enum":["pending","active","frozen","redeemed","expired","cancelled"]},"code_last4":{"type":"string"},"voucher_vat_class":{"type":"string","enum":["spv","mpv"]},"face_value":{"$ref":"#/components/schemas/Money"},"balance":{"$ref":"#/components/schemas/Money"},"available":{"$ref":"#/components/schemas/Money"},"issued_at":{"type":"string"},"expires_at":{"type":"string"},"code":{"type":"string"},"replaced_card_id":{"type":"string"}},"required":["id","program_id","status","code_last4","voucher_vat_class","face_value","balance","available","issued_at","expires_at","code","replaced_card_id"],"additionalProperties":false},"GiftCard":{"type":"object","properties":{"id":{"type":"string"},"program_id":{"type":"string"},"status":{"type":"string","enum":["pending","active","frozen","redeemed","expired","cancelled"]},"code_last4":{"type":"string"},"voucher_vat_class":{"type":"string","enum":["spv","mpv"]},"face_value":{"$ref":"#/components/schemas/Money"},"balance":{"$ref":"#/components/schemas/Money"},"available":{"$ref":"#/components/schemas/Money"},"issued_at":{"type":"string"},"expires_at":{"type":"string"}},"required":["id","program_id","status","code_last4","voucher_vat_class","face_value","balance","available","issued_at","expires_at"],"additionalProperties":false},"CancelGiftCard":{"type":"object","properties":{"refund_remaining":{"type":"boolean","description":"true: pay the remaining value back (VAT corrected for single-purpose vouchers). false: forfeit it to breakage (e.g. fraud)."},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["refund_remaining"],"additionalProperties":false},"RefundToCard":{"type":"object","properties":{"transaction_id":{"type":"string","description":"The redemption to reverse (e.g. a cancelled stay)"}},"required":["transaction_id"],"additionalProperties":false},"TopUpGiftCard":{"type":"object","properties":{"amount":{"type":"string"},"paid":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["amount"],"additionalProperties":false},"ExtendExpiry":{"type":"object","properties":{"expires_at":{"type":"string","description":"New expiry (ISO date-time); must be later than the current one"}},"required":["expires_at"],"additionalProperties":false},"FreezeGiftCard":{"type":"object","properties":{"reason":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},"GiftCardTransaction":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"amount":{"$ref":"#/components/schemas/Money_1"},"location_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"reverses":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor_type":{"type":"string"},"actor_id":{"type":"string"},"effective_at":{"type":"string"}},"required":["id","type","amount","location_id","reason","reverses","actor_type","actor_id","effective_at"],"additionalProperties":false},"Money_1":{"type":"object","properties":{"amount":{"type":"string"},"currency":{"type":"string"}},"required":["amount","currency"],"additionalProperties":false,"description":"Face value moved on the card's visible balance"},"RedeemGiftCard":{"type":"object","properties":{"amount":{"type":"string"},"location_id":{"type":"string"},"lines":{"anyOf":[{"type":"array","prefixItems":[{"$ref":"#/components/schemas/VatLineInput"}],"minItems":1,"items":{"$ref":"#/components/schemas/VatLineInput"}},{"type":"null"}]}},"required":["amount","location_id"],"additionalProperties":false},"LookupGiftCard":{"type":"object","properties":{"code":{"type":"string","maxLength":32}},"required":["code"],"additionalProperties":false},"GiftCardPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GiftCard"}},"has_more":{"type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["data","has_more","next_cursor"],"additionalProperties":false},"IssuedGiftCard":{"type":"object","properties":{"id":{"type":"string"},"program_id":{"type":"string"},"status":{"type":"string","enum":["pending","active","frozen","redeemed","expired","cancelled"]},"code_last4":{"type":"string"},"voucher_vat_class":{"type":"string","enum":["spv","mpv"]},"face_value":{"$ref":"#/components/schemas/Money"},"balance":{"$ref":"#/components/schemas/Money"},"available":{"$ref":"#/components/schemas/Money"},"issued_at":{"type":"string"},"expires_at":{"type":"string"},"code":{"type":"string"}},"required":["id","program_id","status","code_last4","voucher_vat_class","face_value","balance","available","issued_at","expires_at","code"],"additionalProperties":false},"IssueGiftCard":{"type":"object","properties":{"program_id":{"type":"string"},"amount":{"type":"string"},"paid":{"anyOf":[{"type":"string"},{"type":"null"}]},"issuing_location_id":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["program_id","amount"],"additionalProperties":false},"Program":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["draft","active","archived"]},"currency":{"type":"string"},"voucher_vat_class":{"type":"string","enum":["spv","mpv"]},"proposed_vat_class":{"type":"string","enum":["spv","mpv"]},"allowed_categories":{"type":"array","items":{"type":"string","enum":["accommodation","food_beverage","spa","other"]}},"location_ids":{"type":"array","items":{"type":"string"}},"validity_months":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"issuer_entity_id":{"type":"string"},"reloadable":{"type":"boolean"}},"required":["id","name","status","currency","voucher_vat_class","proposed_vat_class","allowed_categories","location_ids","validity_months","issuer_entity_id","reloadable"],"additionalProperties":false},"CreateProgram":{"type":"object","properties":{"name":{"type":"string","minLength":1},"currency":{"type":"string"},"issuer_entity_id":{"type":"string"},"location_ids":{"type":"array","prefixItems":[{"type":"string"}],"minItems":1,"items":{"type":"string"}},"allowed_categories":{"type":"array","prefixItems":[{"type":"string","enum":["accommodation","food_beverage","spa","other"]}],"minItems":1,"items":{"type":"string","enum":["accommodation","food_beverage","spa","other"]}},"voucher_vat_class":{"anyOf":[{"type":"string","enum":["spv","mpv"]},{"type":"null"}]},"validity_months":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reloadable":{"anyOf":[{"type":"boolean","description":"Allow top-ups (default false)"},{"type":"null"}]}},"required":["name","currency","issuer_entity_id","location_ids","allowed_categories"],"additionalProperties":false},"Location":{"type":"object","properties":{"id":{"type":"string"},"legal_entity_id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"country":{"type":"string"},"timezone":{"type":"string"}},"required":["id","legal_entity_id","name","slug","country","timezone"],"additionalProperties":false},"LegalEntity":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"country":{"type":"string"},"vat_number":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","country","vat_number"],"additionalProperties":false}},"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"Workspace API key (lk_live_…)"}}},"security":[{"apiKey":[]}],"tags":[{"name":"System"},{"name":"Organisation"},{"name":"Programs"},{"name":"Gift cards"},{"name":"Holds"},{"name":"Workspace security"},{"name":"Approvals"},{"name":"Webhooks"},{"name":"Bulk issuance"},{"name":"Risk"},{"name":"Reports"}],"servers":[{"url":"https://app.jortkuhlmann.tech/api","description":"This deployment (app.jortkuhlmann.tech)"}]}