{
  "openapi": "3.1.0",
  "info": {
    "title": "VouchMorph partner sandbox API",
    "version": "2026-11-30",
    "summary": "one vouchmorph interface. the standards sit behind it as formats.",
    "description": "the calls between vouchmorph's partner sandbox and a courier, bank or mobile-money operator (mno), read from vouchmorph's code on 30 november 2026. sandbox only: no real money, no real customer data.\n\n**you call us** (`paths`): courier status updates, the console, settlement messages and the sandbox central bank.\n\n**we call you** (`webhooks`): every call vouchmorph makes to your own test system. the paths are examples: yours are the ones on your connection page (couriers) or in your entry (banks and mnos).\n\n**how we read a bank's or mno's answer.** we send json by POST and read json back. a call counts as done only when the http status is 2xx, the body is json and it carries a success signal: `success: true`; or, when `success` is absent, `hold_placed`, `debited`, `released`, `credited` or `processed` for that call; or `status: \"SUCCESS\"`. a 2xx with none of these counts as a failure. a timeout after the request left, a 502 or 504, or a cut-short answer is an unknown outcome: we never send it again, we keep the customer's hold and confirm with you later. so move money once per reference, however often it comes.\n\nthis file is json-compatible yaml: any yaml or json reader opens it. download it at /sandbox/api/openapi (yaml) or /sandbox/api/openapi?format=json.",
    "contact": {
      "name": "the VouchMorph partner desk (address given with your sandbox access)"
    }
  },
  "servers": [
    {
      "url": "https://vouchmorphdeveloper.com",
      "description": "the VouchMorph partner sandbox"
    }
  ],
  "tags": [
    {"name": "couriers", "description": "status updates in, and the six calls we make to a courier"},
    {"name": "console", "description": "what happened to your calls, as json"},
    {"name": "settlement", "description": "settlement advices, messages and the sandbox central bank"},
    {"name": "banks and mnos", "description": "the calls we make to a bank's or mno's test system"},
    {"name": "cards", "description": "a hold on a card through an acquirer"}
  ],
  "x-formats": [
    {"id": "json", "label": "json", "note": "every call", "status": "live"},
    {"id": "iso20022", "label": "iso 20022", "note": "banks", "status": "live", "x-needs": {"wire_format": "iso20022"}},
    {"id": "swift_mt", "label": "swift mt", "note": "banks", "status": "live", "x-needs": {"wire_format": "swift_mt"}},
    {"id": "iso8583", "label": "iso 8583", "note": "cards, atm", "status": "live", "x-needs": {"wire_format": "iso8583"}},
    {"id": "fspiop", "label": "fspiop", "note": "off until a partner needs it", "status": "off"}
  ],
  "x-built-to": [
    {"label": "openapi 3.1", "detail": "this file"},
    {"label": "problem details · rfc 9457", "detail": "settlement messages answer application/problem+json", "x-needs": {"file": "public/api/v1/settlement/messages/index.php"}},
    {"label": "idempotency-key", "detail": "a courier booking carries our reference as its Idempotency-Key"},
    {"label": "mutual tls", "detail": "offered for our calls to your test system", "x-needs": {"wire_sign_in": "mutual_tls"}},
    {"label": "oauth 2.0 client credentials · rfc 6749", "detail": "offered for our calls to your test system", "x-needs": {"wire_sign_in": "oauth2_client_credentials"}}
  ],
  "x-tcp-links": [
    {
      "id": "iso8583CardLink",
      "summary": "card: hold on a card",
      "tags": ["cards"],
      "x-group": "cards",
      "x-status": "live",
      "x-needs": {"wire_format": "iso8583"},
      "x-path": "iso 8583 link · your acquirer",
      "x-setting": "the iso 8583 host and port on the connection page",
      "x-rules": {
        "signed": "your acquirer's link rules",
        "clock": "at least 60 s for a hold or a debit",
        "repeats": "same stan and rrn: one hold"
      },
      "x-example-request": {
        "lines": [
          "TCP <your iso 8583 host>:<port>",
          "",
          "0100  authorization request   places the hold",
          "0200  financial request       takes the hold",
          "0400  reversal                gives the hold back",
          "",
          "field 4   amount in thebe",
          "field 11  stan",
          "field 37  retrieval reference number"
        ]
      },
      "x-example-answer": {
        "lines": [
          "0110 / 0210 / 0410",
          "",
          "field 39  00 approved",
          "field 39  anything else: declined",
          "no answer in time: unknown outcome, never sent again"
        ]
      },
      "description": "not http. when you choose iso 8583 as your format on the connection page, the card calls (verify, hold, debit, release) go to your acquirer's test host as iso 8583 messages over tcp instead of json over https. you save the host and port on the connection page; the address passes the same address rules as an https address before we connect.\n\nthe link carries the same calls as the card ones in this file: an authorization request (0100) places the hold, a financial request (0200) takes it, a reversal (0400) gives it back. your answer's response code (field 39) decides: 00 approved, anything else declined. no answer in time is an unknown outcome, as for http. the field map for each call is on the connection page and in docs/sandbox/portal/FORMATS.md."
    }
  ],
  "paths": {
    "/api/v1/couriers/{courierId}/events": {
      "post": {
        "operationId": "courierEvents",
        "summary": "courier updates",
        "tags": ["couriers"],
        "x-status": "live",
        "x-served-by": "public/api/v1/couriers/index.php",
        "x-rules": {
          "signed": "hmac-sha256: x-courier-signature",
          "clock": "timestamp within 5 minutes",
          "repeats": "same eventId stored once"
        },
        "x-curl": "sign-update",
        "x-example-request": {
          "path": "/api/v1/couriers/SPRINT_BW/events",
          "headers": [
            ["x-courier-timestamp", "1795935600"],
            ["x-courier-signature", "sha256=5d1c…e7a0"],
            ["content-type", "application/json"]
          ]
        },
        "description": "send each status change as it happens. an update only prompts us to read your track endpoint: that read decides whether money locks, is paid to the seller or is released to the buyer. the update's own word never moves money.\n\nsign it: `x-courier-signature` is `sha256=` plus the hex hmac-sha256 of `<x-courier-timestamp>.<raw body>`, keyed with your signing secret (made on the connection page). the timestamp is unix seconds and must be within 5 minutes of our clock. `docs/sandbox/tools/sign-update.sh` (and `.ps1`) sign a body file and print the curl command.\n\nthe same `eventId` again answers 200 with `repeated: true`; an event id is remembered only once the update was handled, so a failed try can be sent again. a status word missing from your status words moves no money and raises an alarm at vouchmorph. the body is at most 65536 bytes.",
        "security": [{"courierSignature": []}],
        "parameters": [
          {
            "name": "courierId",
            "in": "path",
            "required": true,
            "description": "your courier id, as on your connection page",
            "schema": {"type": "string", "pattern": "^[A-Z][A-Z0-9_]{0,54}$"},
            "example": "SPRINT_BW"
          },
          {
            "name": "x-courier-timestamp",
            "in": "header",
            "required": true,
            "description": "when you signed the update, in unix seconds",
            "schema": {"type": "string", "pattern": "^[0-9]{1,12}$"},
            "example": "1795935600"
          },
          {
            "name": "x-courier-signature",
            "in": "header",
            "required": true,
            "description": "sha256= plus the hex hmac-sha256 of \"<timestamp>.<raw body>\" with your signing secret",
            "schema": {"type": "string", "pattern": "^sha256=[0-9a-f]{64}$"}
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {"$ref": "#/components/schemas/CourierUpdate"},
              "examples": {
                "received": {
                  "summary": "the parcel was dropped off at your counter",
                  "value": {
                    "eventId": "evt-000418",
                    "courierReference": "SPX-77120",
                    "clientReference": "VM-SP-20261129-0042",
                    "occurredAt": "2026-11-29T09:12:44+02:00",
                    "status": "received",
                    "place": "Gaborone counter"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "handled: we read your track endpoint and applied what it said. repeated is true when this eventId came before.",
            "headers": {"X-Request-Id": {"$ref": "#/components/headers/RequestId"}},
            "content": {
              "application/json": {
                "schema": {"$ref": "#/components/schemas/CourierUpdateAnswer"},
                "examples": {
                  "handled": {
                    "value": {
                      "success": true,
                      "error": null,
                      "data": {
                        "eventId": "evt-000418",
                        "status": "received",
                        "signal": "received",
                        "gated": true,
                        "outcome": "locked",
                        "repeated": false
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {"$ref": "#/components/responses/MalformedUpdate"},
          "401": {"$ref": "#/components/responses/UpdateNotSigned"},
          "404": {"$ref": "#/components/responses/UnknownCourier"},
          "405": {"$ref": "#/components/responses/MethodNotAllowed"},
          "413": {"$ref": "#/components/responses/PayloadTooLarge"},
          "500": {"$ref": "#/components/responses/InternalError"},
          "503": {"$ref": "#/components/responses/CourierUnavailable"}
        }
      }
    },
    "/api/v1/sandbox/trace": {
      "get": {
        "operationId": "consoleTrace",
        "summary": "the console",
        "tags": ["console"],
        "x-status": "live",
        "x-served-by": "public/api/v1/sandbox/trace/index.php",
        "x-rules": {
          "signed": "bearer: your connection key",
          "clock": "120 reads a minute",
          "repeats": "reads only: safe to repeat"
        },
        "x-example-request": {
          "path": "/api/v1/sandbox/trace?reference=VM-SP-20261129-0042",
          "headers": [
            ["Authorization", "Bearer $CONNECTION_KEY"]
          ]
        },
        "description": "the console's data as json: your payments and today's summary, one payment's timeline, every call in both directions, or the texts and emails kept for your test people. send your connection key as a bearer token, or read it from the console's own session. a reference you may not see answers 404, the same as one that does not exist.\n\nkeys, cookies, tokens and secrets are never shown; a signature shows only as present; id numbers, phone numbers and account numbers are masked. sandbox only.",
        "security": [{"connectionKey": []}],
        "parameters": [
          {"name": "reference", "in": "query", "required": false, "description": "one payment's timeline: our VM- reference", "schema": {"type": "string", "maxLength": 255}, "example": "VM-SP-20261129-0042"},
          {"name": "after", "in": "query", "required": false, "description": "with reference: only events after this event id. with calls or messages: only rows after this id", "schema": {"type": "string", "maxLength": 255}},
          {"name": "calls", "in": "query", "required": false, "description": "all: every call in both directions", "schema": {"type": "string", "enum": ["all"]}},
          {"name": "direction", "in": "query", "required": false, "description": "with calls=all: in (you called us) or out (we called you)", "schema": {"type": "string", "enum": ["in", "out"]}},
          {"name": "refused", "in": "query", "required": false, "description": "with calls=all: 1 for refused calls only", "schema": {"type": "string", "enum": ["1"]}},
          {"name": "messages", "in": "query", "required": false, "description": "1: the texts and emails kept for your test people, codes in full", "schema": {"type": "string", "enum": ["1"]}},
          {"name": "download", "in": "query", "required": false, "description": "1: the same answer as an attachment", "schema": {"type": "string", "enum": ["1"]}},
          {"name": "cases", "in": "query", "required": false, "description": "1: your test cases, each with the counterparts it runs with (slots), for attaching evidence", "schema": {"type": "string", "enum": ["1"]}},
          {"name": "as", "in": "query", "required": false, "description": "vouchmorph staff only: the partner to look as", "schema": {"type": "string"}}
        ],
        "responses": {
          "200": {
            "description": "the answer for what you asked: payments and summary (no parameters), a timeline (reference), calls (calls=all) or messages (messages=1)",
            "headers": {"X-Request-Id": {"$ref": "#/components/headers/RequestId"}},
            "content": {
              "application/json": {
                "schema": {"$ref": "#/components/schemas/Envelope"},
                "examples": {
                  "timeline": {
                    "summary": "?reference=VM-SP-20261129-0042",
                    "value": {
                      "success": true,
                      "error": null,
                      "data": {
                        "reference": "VM-SP-20261129-0042",
                        "amount": 45000,
                        "courier_id": "SPRINT_BW",
                        "stage": "dropped_off",
                        "state": "locked",
                        "events": [
                          {"id": "payment:VM-SP-20261129-0042:held_at", "at": "2026-11-29T07:05:02Z", "kind": "money", "title": "Money held", "detail": "P450.00 held at ZURUBANK.", "outcome": "done"},
                          {"id": "trace:812", "at": "2026-11-29T07:12:45Z", "kind": "update_in", "title": "Status update received", "detail": "POST /api/v1/couriers/SPRINT_BW/events → 200 in 184 ms", "outcome": "ok", "http_status": 200, "ms": 184, "trace_id": 812, "evidence_key": "ev-2026-11-29-812"}
                        ]
                      }
                    }
                  },
                  "summary": {
                    "summary": "no parameters",
                    "value": {
                      "success": true,
                      "error": null,
                      "data": {
                        "viewer": "partner",
                        "partner": {"id": "SPRINT", "name": "Sprint Couriers", "couriers": ["SPRINT_BW", "MBALI_BW"]},
                        "payments": [
                          {"reference": "VM-SP-20261129-0042", "courier_id": "SPRINT_BW", "amount": 45000, "state": "locked", "stage": "dropped_off", "created_at": "2026-11-29T07:02:11Z"}
                        ],
                        "summary": {"calls_today": 14, "refused_today": 1, "avg_ms": 212, "open_payments": 1},
                        "trace_ready": true
                      }
                    }
                  },
                  "messages": {
                    "summary": "?messages=1",
                    "value": {
                      "success": true,
                      "error": null,
                      "data": {
                        "messages": [
                          {"id": 31, "at": "2026-11-29T07:20:03Z", "channel": "sms", "to": "+267 7••• ••01", "subject": null, "text": "Your cash-out voucher 48213906, PIN 5521. Valid 24 hours.", "codes": ["48213906", "5521"]}
                        ],
                        "ready": true
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "no connection key, or a wrong one",
            "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Envelope"}, "examples": {"unauthorized": {"value": {"success": false, "error": {"code": "unauthorized", "message": "Send your connection key as \"Authorization: Bearer <key>\", or sign in to the console."}, "data": null}}}}}
          },
          "404": {
            "description": "no payment with this reference that you may see",
            "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Envelope"}, "examples": {"not_found": {"value": {"success": false, "error": {"code": "not_found", "message": "There is no payment with this reference that you may see."}, "data": null}}}}}
          },
          "405": {"$ref": "#/components/responses/MethodNotAllowed"},
          "429": {
            "description": "more than 120 reads a minute from one address",
            "headers": {"Retry-After": {"description": "seconds to wait", "schema": {"type": "integer"}}},
            "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Envelope"}, "examples": {"too_many": {"value": {"success": false, "error": {"code": "too_many_requests", "message": "Too many requests. Wait 12 seconds."}, "data": null}}}}}
          },
          "500": {"$ref": "#/components/responses/InternalError"},
          "503": {
            "description": "the sandbox's database cannot be reached",
            "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Envelope"}, "examples": {"unavailable": {"value": {"success": false, "error": {"code": "unavailable", "message": "The sandbox's database cannot be reached. Try again in a minute."}, "data": null}}}}}
          }
        }
      },
      "post": {
        "operationId": "consoleAttach",
        "summary": "attach evidence to a case",
        "tags": ["console"],
        "x-status": "live",
        "x-served-by": "public/api/v1/sandbox/trace/index.php",
        "x-rules": {
          "signed": "bearer: your connection key",
          "clock": "120 requests a minute",
          "repeats": "the same call, case and counterpart: kept once"
        },
        "x-example-request": {
          "path": "/api/v1/sandbox/trace",
          "headers": [
            ["Authorization", "Bearer $CONNECTION_KEY"],
            ["Content-Type", "application/json"]
          ]
        },
        "description": "attach one of your calls, by its evidence key, to one of your test cases (P160). every call on your console has an evidence key, `ev-<yyyy-mm-dd>-<id>`; `?cases=1` lists your cases and the counterparts each runs with. your connection key (your only sign-in) or the partner desk may attach; who did is recorded. a case is marked passed or failed on the every-swap page, once it has evidence.\n\na call that is not yours, the example courier's, or a key whose day is not the call's all answer 404, the same as a key that does not exist. from the console page the session and its `X-CSRF-Token` are used instead of the key.",
        "security": [{"connectionKey": []}],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["action", "evidence_key", "case"],
                "properties": {
                  "action": {"type": "string", "enum": ["attach"]},
                  "evidence_key": {"type": "string", "pattern": "^ev-[0-9]{4}-[0-9]{2}-[0-9]{2}-[1-9][0-9]{0,17}$"},
                  "case": {"type": "string", "description": "a case id from ?cases=1, e.g. B-02"},
                  "counterpart": {"type": "string", "description": "one of the case's slots: \"\" (any or none), ONUS, or a participant id", "default": ""},
                  "note": {"type": "string", "maxLength": 500},
                  "as": {"type": "string", "description": "vouchmorph staff only: the partner the evidence is for"}
                }
              },
              "examples": {
                "attach": {"value": {"action": "attach", "evidence_key": "ev-2026-11-30-1234", "case": "B-02", "counterpart": "ZURUBANK", "note": "hold on our statement"}}
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "attached",
            "headers": {"X-Request-Id": {"$ref": "#/components/headers/RequestId"}},
            "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Envelope"}, "examples": {"attached": {"value": {"success": true, "error": null, "data": {"evidence_key": "ev-2026-11-30-1234", "case": "B-02", "counterpart": "ZURUBANK", "already": false, "message": "ev-2026-11-30-1234 attached to B-02."}}}}}}
          },
          "200": {
            "description": "already attached to that case and counterpart: nothing new is kept",
            "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Envelope"}, "examples": {"already": {"value": {"success": true, "error": null, "data": {"evidence_key": "ev-2026-11-30-1234", "case": "B-02", "counterpart": "ZURUBANK", "already": true, "message": "ev-2026-11-30-1234 was already attached to B-02."}}}}}}
          },
          "400": {"description": "bad_request: the body is not a json object; unknown_action: action is not attach", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Envelope"}, "examples": {"unknown_action": {"value": {"success": false, "error": {"code": "unknown_action", "message": "Send \"action\": \"attach\" with evidence_key, case and counterpart."}, "data": null}}}}}},
          "401": {"description": "unauthorized: no or a wrong connection key, and no console session", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Envelope"}, "examples": {"unauthorized": {"value": {"success": false, "error": {"code": "unauthorized", "message": "Send your connection key as \"Authorization: Bearer <key>\", or sign in to the console."}, "data": null}}}}}},
          "403": {"description": "stale_page: a console session without the page's X-CSRF-Token", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Envelope"}, "examples": {"stale_page": {"value": {"success": false, "error": {"code": "stale_page", "message": "The page had been open too long. Reload it and try again."}, "data": null}}}}}},
          "404": {"description": "not_found: no call with this evidence key that you may see", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Envelope"}, "examples": {"not_found": {"value": {"success": false, "error": {"code": "not_found", "message": "There is no call with this evidence key that you may see."}, "data": null}}}}}},
          "405": {"description": "method_not_allowed: Allow: GET, POST", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Envelope"}, "examples": {"method_not_allowed": {"value": {"success": false, "error": {"code": "method_not_allowed", "message": "Read the trace with GET; attach a call to a case with POST."}, "data": null}}}}}},
          "422": {"description": "bad_key: not ev-<yyyy-mm-dd>-<id>; unknown_case: not one of your cases; bad_counterpart: not one this case runs with; pick_partner: staff without as", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Envelope"}, "examples": {"unknown_case": {"value": {"success": false, "error": {"code": "unknown_case", "message": "That is not one of your cases. Your cases are on the every swap page."}, "data": null}}}}}},
          "429": {
            "description": "more than 120 requests a minute from one address",
            "headers": {"Retry-After": {"description": "seconds to wait", "schema": {"type": "integer"}}},
            "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Envelope"}, "examples": {"too_many": {"value": {"success": false, "error": {"code": "too_many_requests", "message": "Too many requests. Wait 12 seconds."}, "data": null}}}}}
          },
          "500": {"$ref": "#/components/responses/InternalError"},
          "503": {"description": "unavailable: the database cannot be reached; not_set_up: the case tables are not in this sandbox yet", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Envelope"}, "examples": {"not_set_up": {"value": {"success": false, "error": {"code": "not_set_up", "message": "Case results are not set up in this sandbox yet. The partner desk has been told."}, "data": null}}}}}}
        }
      }
    },
    "/api/v1/settlement/messages": {
      "post": {
        "operationId": "settlementMessages",
        "summary": "settlement messages",
        "tags": ["settlement"],
        "x-status": "live",
        "x-needs": {"file": "public/api/v1/settlement/messages/index.php"},
        "x-served-by": "public/api/v1/settlement/messages/index.php",
        "x-rules": {
          "signed": "rsa-sha256 or ecdsa p-256: x-signature",
          "clock": "settles in the central bank's next window",
          "repeats": "same reference, same payment: kept once"
        },
        "x-curl": "sign-file",
        "x-example-request": {
          "path": "/api/v1/settlement/messages",
          "headers": [
            ["X-Institution", "ORANGE"],
            ["X-Signature", "kR3v…9Q=="],
            ["Content-Type", "application/xml"]
          ]
        },
        "description": "pay a settlement line in your own bank's format: an iso 20022 pacs.009.001.08 (`application/xml`) or a swift mt202 (`text/plain`). we turn it into a payment for the sandbox central bank, the same fields as its submit_transfer, and it settles in the next clearing window.\n\nsign the raw body with the key of your sandbox certificate (rsa-sha256, or ecdsa p-256 with sha-256) and send the signature in base64 as `x-signature`, with your participant id as `x-institution`. you get the certificate by uploading a certificate request on the connection page.\n\nan error is `application/problem+json` (rfc 9457) with `type`, `title`, `status`, `detail` and, where one fits, `code`, the iso 20022 reason code: FF01 unreadable, AM01 a zero amount, AM03 a currency other than BWP, DS0A not signed, DS0E a signature that does not match, AM05 the reference was used for a different payment, RC01 a bank that is not yours or not a member, AM02 over the limit.",
        "security": [{"settlementSignature": []}],
        "parameters": [
          {"name": "X-Institution", "in": "header", "required": true, "description": "your participant id", "schema": {"type": "string", "pattern": "^[A-Z][A-Z0-9_]{1,19}$"}, "example": "ORANGE"},
          {"name": "X-Signature", "in": "header", "required": true, "description": "base64 rsa-sha256 (or ecdsa p-256 sha-256) signature of the raw body, made with the key of your sandbox certificate", "schema": {"type": "string"}}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/xml": {
              "schema": {"type": "string", "description": "an iso 20022 pacs.009.001.08 financial institution credit transfer"},
              "examples": {
                "pacs009": {
                  "summary": "pay line VMSL-1200-ORZU-1 to ZuruBank",
                  "value": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Document xmlns=\"urn:iso:std:iso:20022:tech:xsd:pacs.009.001.08\">\n  <FICdtTrf>\n    <GrpHdr>\n      <MsgId>ORANGE-20261129-0001</MsgId>\n      <CreDtTm>2026-11-29T12:05:00+02:00</CreDtTm>\n      <NbOfTxs>1</NbOfTxs>\n      <SttlmInf><SttlmMtd>CLRG</SttlmMtd></SttlmInf>\n    </GrpHdr>\n    <CdtTrfTxInf>\n      <PmtId>\n        <InstrId>VMSL-1200-ORZU-1</InstrId>\n        <EndToEndId>VMSL-1200-ORZU-1</EndToEndId>\n      </PmtId>\n      <IntrBkSttlmAmt Ccy=\"BWP\">500.00</IntrBkSttlmAmt>\n      <IntrBkSttlmDt>2026-11-29</IntrBkSttlmDt>\n      <Dbtr><FinInstnId><Othr><Id>ORANGE</Id></Othr></FinInstnId></Dbtr>\n      <DbtrAcct><Id><Othr><Id>VMCLR-ORANGE</Id></Othr></Id></DbtrAcct>\n      <Cdtr><FinInstnId><Othr><Id>ZURUBANK</Id></Othr></FinInstnId></Cdtr>\n      <CdtrAcct><Id><Othr><Id>VMCLR-ZURUBANK</Id></Othr></Id></CdtrAcct>\n    </CdtTrfTxInf>\n  </FICdtTrf>\n</Document>\n"
                }
              }
            },
            "text/plain": {
              "schema": {"type": "string", "description": "a swift mt202 general financial institution transfer"},
              "examples": {
                "mt202": {
                  "summary": "the same line as an mt202",
                  "value": "{1:F01ORANGEXXAXXX0000000000}{2:I202ZURUBANKXXXXN}{4:\n:20:VMSL-1200-ORZU-1\n:21:VMSL-1200-ORZU-1\n:32A:261129BWP500,00\n:52D:/VMCLR-ORANGE\nORANGE\n:58D:/VMCLR-ZURUBANK\nZURUBANK\n-}\n"
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "queued for the central bank's next clearing window",
            "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SettlementAccepted"}, "examples": {"queued": {"value": {"status": "queued", "reference": "VMSL-1200-ORZU-1", "payment_id": 900000014, "settles_in_window": "2026-11-30T12:00:00+02:00", "format": "pacs.009", "message": "Queued for the Mon 12:00 clearing window"}}}}}
          },
          "200": {
            "description": "the same payment again: nothing new is queued",
            "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SettlementAccepted"}, "examples": {"duplicate": {"value": {"status": "queued", "reference": "VMSL-1200-ORZU-1", "payment_id": 900000014, "duplicate": true, "format": "pacs.009", "message": "Already received: the payment is queued"}}}}}
          },
          "400": {"description": "FF01: the message cannot be read (or over 64 KB, or another content type); AM01: a zero amount; AM03: a currency other than BWP", "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}, "examples": {"FF01": {"value": {"type": "about:blank", "title": "The message cannot be read", "status": 400, "detail": "FF01 the pacs.009 has no IntrBkSttlmAmt", "code": "FF01"}}, "AM03": {"value": {"type": "about:blank", "title": "The message cannot be read", "status": 400, "detail": "AM03 the sandbox settles BWP only", "code": "AM03"}}}}}},
          "401": {"description": "DS0A: no X-Institution or X-Signature, or a signature that is not base64; DS0E: a signature that does not match your sandbox certificate (no certificate, expired, not issued by the sandbox, or no match)", "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}, "examples": {"DS0A": {"value": {"type": "about:blank", "title": "Not signed", "status": 401, "detail": "Send X-Institution and a base64 X-Signature of the raw body.", "code": "DS0A"}}, "DS0E": {"value": {"type": "about:blank", "title": "The signature does not match", "status": 401, "detail": "The signature does not match the body.", "code": "DS0E"}}}}}},
          "405": {"description": "not a POST (answer carries Allow: POST)", "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}, "examples": {"post": {"value": {"type": "about:blank", "title": "Method not allowed", "status": 405, "detail": "POST a signed settlement message."}}}}}},
          "409": {"description": "AM05: this reference was used for a different payment", "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}, "examples": {"AM05": {"value": {"type": "about:blank", "title": "Duplicate reference", "status": 409, "detail": "This reference was already used for a different payment", "code": "AM05"}}}}}},
          "422": {"description": "RC01: the paying bank is not the one that signed, or a bank that is not a member of the sandbox central bank (an mno's sponsor settles for it); AM02: over P10,000,000", "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}, "examples": {"RC01": {"value": {"type": "about:blank", "title": "Unknown bank", "status": 422, "detail": "The receiving bank is not a member of the sandbox central bank", "code": "RC01"}}, "AM02": {"value": {"type": "about:blank", "title": "Over the limit", "status": 422, "detail": "amount is over the sandbox limit of P10,000,000 a payment", "code": "AM02"}}}}}},
          "429": {"description": "more than 60 messages a minute from one address", "headers": {"Retry-After": {"description": "seconds to wait", "schema": {"type": "integer"}}}, "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}, "examples": {"too_many": {"value": {"type": "about:blank", "title": "Too many requests", "status": 429, "detail": "More than 60 messages a minute from one address. Wait 12 seconds."}}}}}},
          "503": {"description": "settlement messages are not set up in this sandbox yet", "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}, "examples": {"not_set_up": {"value": {"type": "about:blank", "title": "Not set up", "status": 503, "detail": "Settlement messages are not set up in this sandbox yet."}}}}}}
        }
      }
    },
    "/api/submit_transfer.php": {
      "servers": [
        {"url": "https://centralbank-sandbox-sandbox.up.railway.app", "description": "the sandbox central bank, a stand-in for the Bank of Botswana's clearing and settlement"}
      ],
      "post": {
        "operationId": "centralBankTransfer",
        "summary": "sandbox central bank",
        "tags": ["settlement"],
        "x-status": "live",
        "x-served-by": "scripts/sandbox-centralbank/public/api/submit_transfer.php",
        "x-rules": {
          "signed": "hmac-sha256: authorization",
          "clock": "timestamp within 5 minutes",
          "repeats": "same payment kept once"
        },
        "x-curl": "hmac-file",
        "x-example-request": {
          "path": "/api/submit_transfer.php",
          "headers": [
            ["Authorization", "HMAC ZURUBANK:7be1…04cd"],
            ["Content-Type", "application/json"]
          ]
        },
        "description": "a member bank's settlement desk pays a line from its settlement account to another member's, on the sandbox central bank's own host. it is queued and settles in the next clearing window: 09:00, 12:00, 15:00 or 17:00 botswana time, monday to friday. a settled payment is final; both banks get a signed notice at their registered address.\n\nsign the raw body: `authorization: HMAC <BANK>:<hex hmac-sha256 of the raw body>`, keyed with your bank's central bank secret. `timestamp` is unix seconds within 5 minutes of the central bank's clock. a bank pays only from its own account. the members today are ZURUBANK, SACCUSSALIS and ABSA; an mno settles through its sponsor bank. refusals carry an iso 20022 reason code where one fits.",
        "security": [{"centralBankHmac": []}],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {"$ref": "#/components/schemas/CentralBankInstruction"},
              "examples": {
                "line": {
                  "value": {
                    "sender_bank_code": "ZURUBANK",
                    "sender_account": "VMCLR-ZURUBANK",
                    "recipient_bank_code": "SACCUSSALIS",
                    "recipient_account": "VMCLR-SACCUSSALIS",
                    "amount": 500.00,
                    "reference_code": "VM2611291200-ZURUSACC-P",
                    "origin_transaction_id": "ADV-2611291200-ZURUBANK",
                    "origin_callback_url": "https://zurubank-sandbox.up.railway.app/Backend/api/bank_callback.php",
                    "timestamp": 1795950000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {"description": "queued for the next clearing window", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CentralBankAnswer"}, "examples": {"queued": {"value": {"success": true, "status": "queued", "transfer_id": 900000001, "reference_code": "VM2611291200-ZURUSACC-P", "settles_in_window": "2026-11-30T09:00:00+02:00", "message": "Queued for the Mon 09:00 clearing window"}}}}}},
          "200": {"description": "the same payment again: the first one's state", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CentralBankAnswer"}, "examples": {"duplicate": {"value": {"success": true, "duplicate": true, "status": "queued", "transfer_id": 900000001, "reference_code": "VM2611291200-ZURUSACC-P", "message": "Already received: the payment is queued", "settles_in_window": "2026-11-30T09:00:00+02:00"}}}}}},
          "401": {"description": "no signature, a wrong one, a bank that is not a member, or DT01: a timestamp missing or more than five minutes off", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CentralBankAnswer"}, "examples": {"DT01": {"value": {"success": false, "status": "rejected", "code": "DT01", "message": "The request timestamp is more than five minutes off"}}}}}},
          "403": {"description": "a bank paying from another bank's account", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CentralBankAnswer"}, "examples": {"not_yours": {"value": {"success": false, "status": "rejected", "code": null, "message": "ZURUBANK can pay only from its own settlement account"}}}}}},
          "405": {"description": "not a POST", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CentralBankAnswer"}, "examples": {"post": {"value": {"success": false, "status": "rejected", "code": null, "message": "POST a signed payment instruction"}}}}}},
          "409": {"description": "AM05: the reference was used for a different payment", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CentralBankAnswer"}, "examples": {"AM05": {"value": {"success": false, "status": "rejected", "code": "AM05", "message": "This reference was already used for a different payment"}}}}}},
          "413": {"description": "FF01: the body is over 16384 bytes", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CentralBankAnswer"}, "examples": {"too_large": {"value": {"success": false, "status": "rejected", "code": "FF01", "message": "The request is too large"}}}}}},
          "422": {"description": "FF01 a malformed field, RC01 a receiving bank that is not a member, AM02 over P10,000,000", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CentralBankAnswer"}, "examples": {"RC01": {"value": {"success": false, "status": "rejected", "code": "RC01", "message": "The receiving bank is not a member of the sandbox central bank"}}}}}},
          "503": {"description": "the central bank has no key for that bank yet, or cannot take requests now", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CentralBankAnswer"}, "examples": {"no_key": {"value": {"success": false, "status": "rejected", "code": null, "message": "The sandbox central bank has no key for ZURUBANK yet"}}}}}}
        }
      }
    },
    "/api/v1/interop/fspiop/transfers": {
      "post": {
        "operationId": "fspiopTransfers",
        "summary": "fspiop format",
        "tags": ["settlement"],
        "x-status": "off",
        "x-rules": {
          "signed": "off",
          "clock": "off",
          "repeats": "off"
        },
        "x-curl": "none",
        "description": "off until a partner needs it. the mojaloop fspiop transfers call is not served, in the sandbox or in production. tell the partner desk if your system speaks fspiop, and it is built for you.",
        "responses": {
          "default": {"description": "not served: off until a partner needs it"}
        }
      }
    }
  },
  "webhooks": {
    "courierOffices": {
      "get": {
        "operationId": "courierOffices",
        "summary": "courier: offices",
        "tags": ["couriers"],
        "x-group": "couriers",
        "x-status": "live",
        "x-path": "/v1/offices",
        "x-setting": "offices path on the connection page",
        "x-rules": {"signed": "your key in your header", "clock": "30 s to answer", "repeats": "a read: safe to repeat"},
        "x-example-request": {
          "url": "https://test.sprint.example/v1/offices",
          "headers": [["Accept", "application/json"], ["Authorization", "Bearer $COURIER_KEY"]]
        },
        "description": "your offices, for the seller's and the buyer's pickers. answer a json list of offices, each with an `id`. check connection needs at least one office with an id.",
        "security": [{"yourCourierKey": []}],
        "responses": {
          "200": {"description": "your offices", "content": {"application/json": {"examples": {"offices": {"value": [{"id": "GAB-01", "name": "Gaborone main mall", "town": "Gaborone"}, {"id": "FRA-02", "name": "Francistown station", "town": "Francistown"}]}}}}},
          "4XX": {"$ref": "#/components/responses/YourRefusal"},
          "5XX": {"$ref": "#/components/responses/YourOutage"}
        }
      }
    },
    "courierQuote": {
      "post": {
        "operationId": "courierQuote",
        "summary": "courier: quote",
        "tags": ["couriers"],
        "x-group": "couriers",
        "x-status": "live",
        "x-path": "/v1/quotes",
        "x-setting": "quote path on the connection page",
        "x-rules": {"signed": "your key in your header", "clock": "30 s to answer", "repeats": "a price: safe to repeat"},
        "x-example-request": {
          "url": "https://test.sprint.example/v1/quotes",
          "headers": [["Accept", "application/json"], ["Content-Type", "application/json"], ["Authorization", "Bearer $COURIER_KEY"]]
        },
        "description": "the price for a parcel. answer `chargeThebe` (whole thebe), `currency` and `validUntil`. check connection prices 1 kg from your first office.",
        "security": [{"yourCourierKey": []}],
        "requestBody": {"required": true, "content": {"application/json": {"examples": {"quote": {"value": {"fromOfficeId": "GAB-01", "to": {"officeId": "FRA-02"}, "weightGrams": 1000}}}}}},
        "responses": {
          "200": {"description": "the price", "content": {"application/json": {"examples": {"price": {"value": {"chargeThebe": 6500, "currency": "BWP", "validUntil": "2026-11-29T10:12:44+02:00"}}}}}},
          "4XX": {"$ref": "#/components/responses/YourRefusal"},
          "5XX": {"$ref": "#/components/responses/YourOutage"}
        }
      }
    },
    "courierBook": {
      "post": {
        "operationId": "courierBook",
        "summary": "courier: book",
        "tags": ["couriers"],
        "x-group": "couriers",
        "x-status": "live",
        "x-path": "/v1/bookings",
        "x-setting": "book path on the connection page",
        "x-rules": {"signed": "your key in your header", "clock": "30 s to answer", "repeats": "idempotency-key: books once"},
        "x-example-request": {
          "url": "https://test.sprint.example/v1/bookings",
          "headers": [["Accept", "application/json"], ["Content-Type", "application/json"], ["Authorization", "Bearer $COURIER_KEY"], ["Idempotency-Key", "VM-SP-20261129-0042"]]
        },
        "description": "a booking. our reference is the `clientReference` and also the `Idempotency-Key`, so a retry never books twice: answer the first booking again. answer your `courierReference`. the body holds made-up id numbers and phone numbers in the sandbox; we never log it.",
        "security": [{"yourCourierKey": []}],
        "parameters": [
          {"name": "Idempotency-Key", "in": "header", "required": true, "description": "our reference, the same as clientReference", "schema": {"type": "string", "maxLength": 200}, "example": "VM-SP-20261129-0042"}
        ],
        "requestBody": {"required": true, "content": {"application/json": {"examples": {"booking": {"value": {"clientReference": "VM-SP-20261129-0042", "sender": {"name": "Thato Test", "idNumber": "000000001", "phone": "+26770000001"}, "receiver": {"name": "Kagiso Test", "idNumber": "000000002", "phone": "+26770000002", "mode": "collect", "officeId": "FRA-02"}, "item": {"description": "A made-up parcel"}, "deliveryChargePaidBy": "buyer"}}}}}},
        "responses": {
          "200": {"description": "booked (or the same booking again)", "content": {"application/json": {"examples": {"booked": {"value": {"courierReference": "SPX-77120", "clientReference": "VM-SP-20261129-0042", "status": "booked"}}}}}},
          "4XX": {"$ref": "#/components/responses/YourRefusal"},
          "5XX": {"$ref": "#/components/responses/YourOutage"}
        }
      }
    },
    "courierWaybill": {
      "get": {
        "operationId": "courierWaybill",
        "summary": "courier: waybill",
        "tags": ["couriers"],
        "x-group": "couriers",
        "x-status": "live",
        "x-path": "/v1/bookings/{ref}/waybill",
        "x-setting": "waybill path on the connection page",
        "x-rules": {"signed": "your key in your header", "clock": "30 s to answer", "repeats": "a read: safe to repeat"},
        "x-example-request": {
          "url": "https://test.sprint.example/v1/bookings/SPX-77120/waybill",
          "headers": [["Accept", "application/json"], ["Authorization", "Bearer $COURIER_KEY"]]
        },
        "description": "the waybill for the counter. `{ref}` is either reference: yours, or our VM- reference.",
        "security": [{"yourCourierKey": []}],
        "responses": {
          "200": {"description": "the waybill, as json", "content": {"application/json": {"examples": {"waybill": {"value": {"courierReference": "SPX-77120", "clientReference": "VM-SP-20261129-0042", "waybillNumber": "WB-77120", "from": "GAB-01", "to": "FRA-02"}}}}}},
          "4XX": {"$ref": "#/components/responses/YourRefusal"},
          "5XX": {"$ref": "#/components/responses/YourOutage"}
        }
      }
    },
    "courierTrack": {
      "get": {
        "operationId": "courierTrack",
        "summary": "courier: track",
        "tags": ["couriers"],
        "x-group": "couriers",
        "x-status": "live",
        "x-path": "/v1/bookings/{ref}",
        "x-setting": "track path on the connection page",
        "x-rules": {"signed": "your key in your header", "clock": "30 s to answer", "repeats": "a read: safe to repeat"},
        "x-example-request": {
          "url": "https://test.sprint.example/v1/bookings/SPX-77120",
          "headers": [["Accept", "application/json"], ["Authorization", "Bearer $COURIER_KEY"]]
        },
        "description": "the booking's status now. **this read decides**: only it can lock or release money. we read it after each update you send (with your reference) and on our own schedule (with our VM- reference), so find a booking by either. answer `status` (your status word), `clientReference` (our reference) and `events` (oldest first, each with `eventId`, `status` and `occurredAt`, and optional `place` and `note`); `collectBy` when the parcel waits at a counter. an answer without status or clientReference is refused.",
        "security": [{"yourCourierKey": []}],
        "responses": {
          "200": {"description": "the booking's status and its events", "content": {"application/json": {"examples": {"received": {"value": {"courierReference": "SPX-77120", "clientReference": "VM-SP-20261129-0042", "status": "received", "events": [{"eventId": "evt-000412", "status": "booked", "occurredAt": "2026-11-29T09:03:10+02:00"}, {"eventId": "evt-000418", "status": "received", "occurredAt": "2026-11-29T09:12:44+02:00", "place": "Gaborone counter"}]}}}}}},
          "404": {"description": "no such booking: shows on the console as a refused call", "content": {"application/json": {"examples": {"not_found": {"value": {"code": "not_found", "message": "No booking has this reference."}}}}}},
          "4XX": {"$ref": "#/components/responses/YourRefusal"},
          "5XX": {"$ref": "#/components/responses/YourOutage"}
        }
      }
    },
    "courierCancel": {
      "post": {
        "operationId": "courierCancel",
        "summary": "courier: cancel",
        "tags": ["couriers"],
        "x-group": "couriers",
        "x-status": "live",
        "x-path": "/v1/bookings/{ref}/cancel",
        "x-setting": "cancel path on the connection page",
        "x-rules": {"signed": "your key in your header", "clock": "30 s to answer", "repeats": "asked again until you answer"},
        "x-example-request": {
          "url": "https://test.sprint.example/v1/bookings/VM-SP-20261129-0042/cancel",
          "headers": [["Accept", "application/json"], ["Content-Type", "application/json"], ["Authorization", "Bearer $COURIER_KEY"]]
        },
        "description": "a cancel before drop-off, by our VM- reference. answer `status: \"cancelled\"` once it is cancelled. we keep asking until you answer; a parcel already dropped off is refused with your own error code.",
        "security": [{"yourCourierKey": []}],
        "requestBody": {"required": true, "content": {"application/json": {"examples": {"cancel": {"value": {"reason": "hold_failed"}}}}}},
        "responses": {
          "200": {"description": "cancelled", "content": {"application/json": {"examples": {"cancelled": {"value": {"courierReference": "SPX-77120", "clientReference": "VM-SP-20261129-0042", "status": "cancelled"}}}}}},
          "4XX": {"$ref": "#/components/responses/YourRefusal"},
          "5XX": {"$ref": "#/components/responses/YourOutage"}
        }
      }
    },
    "bankVerifyAsset": {
      "post": {
        "operationId": "bankVerifyAsset",
        "summary": "bank: verify the source",
        "tags": ["banks and mnos"],
        "x-group": "banks",
        "x-status": "live",
        "x-path": "/api/v1/verify_asset.php",
        "x-setting": "verify_asset (endpoints.source.verify_asset)",
        "x-rules": {"signed": "vouchmorph's certificate: signature", "clock": "30 s to answer", "repeats": "moves nothing: safe to repeat"},
        "x-example-request": {
          "url": "https://test.yourbank.example/api/v1/verify_asset.php",
          "headers": [["Content-Type", "application/json"], ["Accept", "application/json"], ["X-Correlation-ID", "SWAP_1795935600_3f9a2c7e51b04d18"], ["X-API-KEY", "$BANK_KEY"]]
        },
        "description": "is this account or wallet yours, and can it pay this amount? the customer's identifier comes as `source_identifier` and, for older systems, also as `account_number`, `phone`, `wallet_phone`, `national_id` and `email`. answer `success`, `verified`, and if you can `balance` (or `available_balance`), `currency` and `account_name`. a balance you send is checked against the amount; send none rather than 0 when you cannot say.\n\na signed call carries `signature` (base64 rsa-sha256 over the body as json with its keys sorted, without `requester`, `signature` and `certificate`), `certificate` (vouchmorph's pem) and `requester: VOUCHMORPH`.",
        "security": [{"yourBankKey": []}],
        "parameters": [{"$ref": "#/components/parameters/CorrelationId"}],
        "requestBody": {"required": true, "content": {"application/json": {"examples": {"verify": {"value": {"action": "VERIFY_ASSET", "reference": "SWAP_1795935600_3f9a2c7e51b04d18", "asset_type": "ACCOUNT", "amount": 250, "currency": "BWP", "institution": "ORANGE", "swap_type": "STANDARD", "from_institution": "ORANGE", "source_institution": "ORANGE", "source_identifier": "77100001", "source_identifier_type": "account", "account_number": "77100001", "phone": "77100001", "wallet_phone": "77100001", "national_id": "77100001", "email": "77100001", "timestamp": 1795935600, "signature": "<base64 rsa-sha256>", "requester": "VOUCHMORPH", "certificate": "-----BEGIN CERTIFICATE-----\n…\n-----END CERTIFICATE-----"}}}}}},
        "responses": {
          "200": {"description": "verified", "content": {"application/json": {"examples": {"verified": {"value": {"success": true, "verified": true, "balance": 1200.00, "currency": "BWP", "account_name": "Thato Test", "message": "Asset verified"}}}}}},
          "4XX": {"$ref": "#/components/responses/BankRefusal"},
          "5XX": {"$ref": "#/components/responses/BankOutage"}
        }
      }
    },
    "bankVerifyAccount": {
      "post": {
        "operationId": "bankVerifyAccount",
        "summary": "bank: verify the destination",
        "tags": ["banks and mnos"],
        "x-group": "banks",
        "x-status": "live",
        "x-path": "/api/v1/verify_account.php",
        "x-setting": "verify_account (endpoints.destination_deposit.verify_account)",
        "x-rules": {"signed": "your key in your header", "clock": "30 s to answer", "repeats": "moves nothing: safe to repeat"},
        "x-example-request": {
          "url": "https://test.yourbank.example/api/v1/verify_account.php",
          "headers": [["Content-Type", "application/json"], ["Accept", "application/json"], ["X-Correlation-ID", "VERIFY_8c1f04a2e9b3"], ["X-API-KEY", "$BANK_KEY"]]
        },
        "description": "before we pay into an account or wallet at your bank: does it exist and can it take money? the identifier comes as `account_identifier` with `identifier_type`, and also as `account_number`, `phone`, `wallet_phone` and `msisdn` for systems that look up by those. answer `success`, `verified` and if you can `account_name` (or `holder_name`), `account_type`, `currency` and `status`.",
        "security": [{"yourBankKey": []}],
        "parameters": [{"$ref": "#/components/parameters/CorrelationId"}],
        "requestBody": {"required": true, "content": {"application/json": {"examples": {"verify": {"value": {"action": "VERIFY_ACCOUNT", "account_identifier": "26771000002", "identifier_type": "phone", "destination_asset_type": "WALLET", "asset_type": "WALLET", "timestamp": 1795935600, "reference": "VERIFY_8c1f04a2e9b3", "requester": "VOUCHMORPH", "phone": "26771000002", "wallet_phone": "26771000002", "msisdn": "26771000002", "account_number": "26771000002"}}}}}},
        "responses": {
          "200": {"description": "found", "content": {"application/json": {"examples": {"found": {"value": {"success": true, "verified": true, "account_name": "Kagiso Test", "account_type": "WALLET", "currency": "BWP", "status": "active"}}}}}},
          "4XX": {"$ref": "#/components/responses/BankRefusal"},
          "5XX": {"$ref": "#/components/responses/BankOutage"}
        }
      }
    },
    "bankPlaceHold": {
      "post": {
        "operationId": "bankPlaceHold",
        "summary": "bank: place a hold",
        "tags": ["banks and mnos"],
        "x-group": "banks",
        "x-status": "live",
        "x-path": "/api/v1/hold.php",
        "x-setting": "place_hold (endpoints.source.place_hold)",
        "x-rules": {"signed": "vouchmorph's certificate: signature", "clock": "at least 60 s to answer", "repeats": "same reference: one hold"},
        "x-example-request": {
          "url": "https://test.yourbank.example/api/v1/hold.php",
          "headers": [["Content-Type", "application/json"], ["Accept", "application/json"], ["X-Correlation-ID", "SWAP_1795935600_3f9a2c7e51b04d18"], ["X-API-KEY", "$BANK_KEY"]]
        },
        "description": "hold an amount in the customer's account or wallet, under our reference, until `expiry`. the hold names the destination institution and person, so the signature binds who is paid. answer `success` (or `hold_placed`), your `hold_reference` (or `authorization_reference`) and if you have one `hold_id`; these may also sit one level down under `data`. the same reference twice is one hold.\n\nsigned like verify. a hold that times out after it left is an unknown outcome: we do not send it again.",
        "security": [{"yourBankKey": []}],
        "parameters": [{"$ref": "#/components/parameters/CorrelationId"}],
        "requestBody": {"required": true, "content": {"application/json": {"examples": {"hold": {"value": {"action": "PLACE_HOLD", "reference": "SWAP_1795935600_3f9a2c7e51b04d18", "asset_type": "ACCOUNT", "amount": 250, "currency": "BWP", "hold_reason": "PENDING_SWAP", "destination_institution": "ZURUBANK", "destination_identifier": "26771000002", "destination_identifier_type": "phone", "expiry": "2026-11-30 09:00:00", "from_institution": "ORANGE", "source_institution": "ORANGE", "user_id": 7, "source_identifier": "77100001", "account_number": "77100001", "phone": "77100001", "wallet_phone": "77100001", "national_id": "77100001", "email": "77100001", "timestamp": 1795935600, "signature": "<base64 rsa-sha256>", "requester": "VOUCHMORPH", "certificate": "-----BEGIN CERTIFICATE-----\n…\n-----END CERTIFICATE-----"}}}}}},
        "responses": {
          "200": {"description": "held", "content": {"application/json": {"examples": {"held": {"value": {"success": true, "hold_placed": true, "hold_reference": "HLD-20261129-000231", "hold_id": "231", "status": "ACTIVE", "message": "Hold placed"}}}}}},
          "4XX": {"$ref": "#/components/responses/BankRefusal"},
          "5XX": {"$ref": "#/components/responses/BankOutage"}
        }
      }
    },
    "bankDebit": {
      "post": {
        "operationId": "bankDebit",
        "summary": "bank: take the hold",
        "tags": ["banks and mnos"],
        "x-group": "banks",
        "x-status": "live",
        "x-path": "/api/v1/settlement/notify_debit.php",
        "x-setting": "debit_funds (endpoints.source.debit_funds)",
        "x-rules": {"signed": "vouchmorph's certificate: signature", "clock": "at least 60 s to answer", "repeats": "same hold: one debit"},
        "x-example-request": {
          "url": "https://test.yourbank.example/api/v1/settlement/notify_debit.php",
          "headers": [["Content-Type", "application/json"], ["Accept", "application/json"], ["X-Correlation-ID", "HLD-20261129-000231"], ["X-API-KEY", "$BANK_KEY"]]
        },
        "description": "take the held amount, once the money has reached the other side. `reference` and `hold_reference` both carry your hold reference. answer `success` (or `debited`) and your `transaction_reference`; the same hold twice is one debit.",
        "security": [{"yourBankKey": []}],
        "parameters": [{"$ref": "#/components/parameters/CorrelationId"}],
        "requestBody": {"required": true, "content": {"application/json": {"examples": {"debit": {"value": {"action": "DEBIT_FUNDS", "reference": "HLD-20261129-000231", "hold_reference": "HLD-20261129-000231", "amount": 250, "reason": "Swap completed successfully", "from_institution": "ORANGE", "source_institution": "ORANGE", "source_identifier": "77100001", "account_number": "77100001", "phone": "77100001", "wallet_phone": "77100001", "national_id": "77100001", "email": "77100001", "timestamp": 1795935660, "signature": "<base64 rsa-sha256>", "requester": "VOUCHMORPH", "certificate": "-----BEGIN CERTIFICATE-----\n…\n-----END CERTIFICATE-----"}}}}}},
        "responses": {
          "200": {"description": "taken", "content": {"application/json": {"examples": {"debited": {"value": {"success": true, "debited": true, "transaction_reference": "TXN-20261129-004417", "status": "COMPLETED"}}}}}},
          "4XX": {"$ref": "#/components/responses/BankRefusal"},
          "5XX": {"$ref": "#/components/responses/BankOutage"}
        }
      }
    },
    "bankReleaseHold": {
      "post": {
        "operationId": "bankReleaseHold",
        "summary": "bank: release a hold",
        "tags": ["banks and mnos"],
        "x-group": "banks",
        "x-status": "live",
        "x-path": "/api/v1/hold.php",
        "x-setting": "release_hold (endpoints.source.release_hold)",
        "x-rules": {"signed": "vouchmorph's certificate: signature", "clock": "at least 60 s to answer", "repeats": "same hold: released once"},
        "x-example-request": {
          "url": "https://test.yourbank.example/api/v1/hold.php",
          "headers": [["Content-Type", "application/json"], ["Accept", "application/json"], ["X-Correlation-ID", "HLD-20261129-000231"], ["X-API-KEY", "$BANK_KEY"]]
        },
        "description": "give a hold back in full. `reference` and `hold_reference` both carry your hold reference, with the customer's identifier so you can find the account. answer `success` (or `released`); a hold already released answers success again.",
        "security": [{"yourBankKey": []}],
        "parameters": [{"$ref": "#/components/parameters/CorrelationId"}],
        "requestBody": {"required": true, "content": {"application/json": {"examples": {"release": {"value": {"action": "RELEASE_HOLD", "reference": "HLD-20261129-000231", "hold_reference": "HLD-20261129-000231", "asset_type": "ACCOUNT", "source_identifier": "77100001", "account_number": "77100001", "phone": "77100001", "wallet_phone": "77100001", "national_id": "77100001", "email": "77100001", "timestamp": 1795935700, "signature": "<base64 rsa-sha256>", "requester": "VOUCHMORPH", "certificate": "-----BEGIN CERTIFICATE-----\n…\n-----END CERTIFICATE-----"}}}}}},
        "responses": {
          "200": {"description": "released", "content": {"application/json": {"examples": {"released": {"value": {"success": true, "released": true, "status": "RELEASED", "released_at": "2026-11-29 09:15:00"}}}}}},
          "4XX": {"$ref": "#/components/responses/BankRefusal"},
          "5XX": {"$ref": "#/components/responses/BankOutage"}
        }
      }
    },
    "bankDeposit": {
      "post": {
        "operationId": "bankDeposit",
        "summary": "bank: deposit with proof",
        "tags": ["banks and mnos"],
        "x-group": "banks",
        "x-status": "live",
        "x-path": "/api/v1/deposit/direct.php",
        "x-setting": "process_deposit (endpoints.destination_deposit.process_deposit)",
        "x-rules": {"signed": "vouchmorph's certificate + the source's proof", "clock": "at least 60 s to answer", "repeats": "same reference: credited once"},
        "x-example-request": {
          "url": "https://test.yourbank.example/api/v1/deposit/direct.php",
          "headers": [["Content-Type", "application/json"], ["Accept", "application/json"], ["X-Correlation-ID", "SWAP_1795935600_3f9a2c7e51b04d18"], ["X-API-KEY", "$BANK_KEY"]]
        },
        "description": "pay an amount into an account, wallet or card at your bank, with the source bank's signed proof: `source_verification` and `source_hold` are the source's own signed answers. check the source's signature, and that its hold names this person, before you credit. the destination is `account_number` (an account), `phone` and `wallet_phone` (a wallet) or `card_token` (a card), and always `destination_identifier`. answer `success` (or `credited`, or `processed`) and your `transaction_reference`.",
        "security": [{"yourBankKey": []}],
        "parameters": [{"$ref": "#/components/parameters/CorrelationId"}],
        "requestBody": {"required": true, "content": {"application/json": {"examples": {"deposit": {"value": {"action": "PROCESS_DEPOSIT_WITH_PROOF", "reference": "SWAP_1795935600_3f9a2c7e51b04d18", "amount": 250, "currency": "BWP", "source_verification": {"verified": true, "signature": "<the source's signature>"}, "source_hold": {"hold_reference": "HLD-20261129-000231", "signature": "<the source's signature>"}, "source_details": [], "from_institution": "ORANGE", "source_institution": "ORANGE", "to_institution": "ZURUBANK", "destination_institution": "ZURUBANK", "bank": "ORANGE", "destination_asset_type": "WALLET", "asset_type": "WALLET", "user_id": 7, "source_identifier": "77100001", "source_identifier_type": "account", "source_account": "77100001", "destination_identifier": "26771000002", "destination_identifier_type": "phone", "phone": "26771000002", "wallet_phone": "26771000002", "beneficiary_phone": "26771000002", "hold_reference": "HLD-20261129-000231", "_skip_hold": true, "timestamp": 1795935640, "signature": "<base64 rsa-sha256>", "requester": "VOUCHMORPH", "certificate": "-----BEGIN CERTIFICATE-----\n…\n-----END CERTIFICATE-----"}}}}}},
        "responses": {
          "200": {"description": "credited", "content": {"application/json": {"examples": {"credited": {"value": {"success": true, "credited": true, "transaction_reference": "DEP-20261129-000877", "status": "COMPLETED", "new_balance": 1450.00}}}}}},
          "4XX": {"$ref": "#/components/responses/BankRefusal"},
          "5XX": {"$ref": "#/components/responses/BankOutage"}
        }
      }
    },
    "bankBalance": {
      "post": {
        "operationId": "bankBalance",
        "summary": "bank: balance",
        "tags": ["banks and mnos"],
        "x-group": "banks",
        "x-status": "live",
        "x-path": "/api/v1/accounts/balance.php",
        "x-setting": "get_balance (endpoints.source.get_balance)",
        "x-rules": {"signed": "your key; signed with mutual tls", "clock": "30 s to answer", "repeats": "a read: safe to repeat"},
        "x-example-request": {
          "url": "https://test.yourbank.example/api/v1/accounts/balance.php",
          "headers": [["Content-Type", "application/json"], ["Accept", "application/json"], ["X-API-KEY", "$BANK_KEY"]]
        },
        "description": "the customer's balance, for the dashboard and for a batch's funds check. it is a POST with the identifier in the body, like every bank call. a wallet's pin, when the customer gave one, comes as `pin` and `wallet_pin`. answer `success` and `balance` (or `available_balance`), at the top or under `data`.",
        "security": [{"yourBankKey": []}],
        "requestBody": {"required": true, "content": {"application/json": {"examples": {"balance": {"value": {"source_identifier": "77100001", "account_number": "77100001", "phone": "77100001", "wallet_phone": "77100001", "national_id": "77100001", "email": "77100001", "currency": "BWP"}}}}}},
        "responses": {
          "200": {"description": "the balance", "content": {"application/json": {"examples": {"balance": {"value": {"success": true, "balance": 1200.00, "available_balance": 950.00, "currency": "BWP"}}}}}},
          "4XX": {"$ref": "#/components/responses/BankRefusal"},
          "5XX": {"$ref": "#/components/responses/BankOutage"}
        }
      }
    },
    "cashoutIssue": {
      "post": {
        "operationId": "cashoutIssue",
        "summary": "bank: issue a cash-out code",
        "tags": ["banks and mnos"],
        "x-group": "banks",
        "x-status": "live",
        "x-path": "/api/v1/atm/generate_code.php",
        "x-setting": "generate_token (endpoints.destination_cashout.generate_token)",
        "x-rules": {"signed": "vouchmorph's certificate + the source's proof", "clock": "at least 60 s to answer", "repeats": "same reference: one code"},
        "x-example-request": {
          "url": "https://test.yourbank.example/api/v1/atm/generate_code.php",
          "headers": [["Content-Type", "application/json"], ["Accept", "application/json"], ["X-Correlation-ID", "SWAP_1795935600_3f9a2c7e51b04d18"], ["X-API-KEY", "$BANK_KEY"]]
        },
        "description": "a code the customer takes to your atm or agent, backed by the source's signed hold. answer `success`, the code (`cashout_code`, `code` or `sat_number`), the pin (`atm_pin` or `pin`), `voucher_number` and `expires_at`. we text the code and pin to `beneficiary_phone`; in the sandbox the text is kept for the console's messages tab instead.",
        "security": [{"yourBankKey": []}],
        "parameters": [{"$ref": "#/components/parameters/CorrelationId"}],
        "requestBody": {"required": true, "content": {"application/json": {"examples": {"issue": {"value": {"action": "GENERATE_TOKEN", "reference": "SWAP_1795935600_3f9a2c7e51b04d18", "amount": 200, "currency": "BWP", "hold_reference": "HLD-20261129-000231", "expiry": "2026-11-30 09:00:00", "expires_at": "2026-11-30 09:00:00", "source_verification": {"verified": true, "signature": "<the source's signature>"}, "source_hold": {"hold_reference": "HLD-20261129-000231", "signature": "<the source's signature>"}, "beneficiary_phone": "26771000002", "from_institution": "ORANGE", "source_institution": "ORANGE", "to_institution": "ZURUBANK", "destination_institution": "ZURUBANK", "source_identifier": "77100001", "source_identifier_type": "account", "timestamp": 1795935640, "signature": "<base64 rsa-sha256>", "requester": "VOUCHMORPH", "certificate": "-----BEGIN CERTIFICATE-----\n…\n-----END CERTIFICATE-----"}}}}}},
        "responses": {
          "200": {"description": "the code", "content": {"application/json": {"examples": {"issued": {"value": {"success": true, "cashout_code": "48213906", "voucher_number": "48213906", "atm_pin": "5521", "expires_at": "2026-11-30 09:00:00", "transaction_reference": "ATM-20261129-000112"}}}}}},
          "4XX": {"$ref": "#/components/responses/BankRefusal"},
          "5XX": {"$ref": "#/components/responses/BankOutage"}
        }
      }
    },
    "cashoutVerify": {
      "post": {
        "operationId": "cashoutVerify",
        "summary": "bank: check a cash-out code",
        "tags": ["banks and mnos"],
        "x-group": "banks",
        "x-status": "live",
        "x-path": "/api/v1/atm/atm_cashout.php",
        "x-setting": "verify_token (endpoints.destination_cashout.verify_token)",
        "x-rules": {"signed": "your key in your header", "clock": "at least 60 s to answer", "repeats": "same code: paid once"},
        "x-example-request": {
          "url": "https://test.yourbank.example/api/v1/atm/atm_cashout.php",
          "headers": [["Content-Type", "application/json"], ["Accept", "application/json"], ["X-Correlation-ID", "SWAP_1795935600_3f9a2c7e51b04d18"], ["X-API-KEY", "$BANK_KEY"]]
        },
        "description": "is this code and pin good for this amount? at some banks this call is the atm cash-out itself, so we give it the time of a call that moves money. answer `success`, `verified`, `amount` and `beneficiary`.",
        "security": [{"yourBankKey": []}],
        "parameters": [{"$ref": "#/components/parameters/CorrelationId"}],
        "requestBody": {"required": true, "content": {"application/json": {"examples": {"verify": {"value": {"reference": "SWAP_1795935600_3f9a2c7e51b04d18", "voucher_number": "48213906", "voucher_pin": "5521", "amount": 200, "currency": "BWP"}}}}}},
        "responses": {
          "200": {"description": "good", "content": {"application/json": {"examples": {"verified": {"value": {"success": true, "verified": true, "amount": 200, "beneficiary": "26771000002"}}}}}},
          "4XX": {"$ref": "#/components/responses/BankRefusal"},
          "5XX": {"$ref": "#/components/responses/BankOutage"}
        }
      }
    },
    "cashoutConfirm": {
      "post": {
        "operationId": "cashoutConfirm",
        "summary": "bank: confirm a cash-out",
        "tags": ["banks and mnos"],
        "x-group": "banks",
        "x-status": "live",
        "x-path": "/api/v1/atm_cashout.php",
        "x-setting": "confirm_cashout (endpoints.destination_cashout.confirm_cashout)",
        "x-rules": {"signed": "your key in your header", "clock": "at least 60 s to answer", "repeats": "same code: confirmed once"},
        "x-example-request": {
          "url": "https://test.yourbank.example/api/v1/atm_cashout.php",
          "headers": [["Content-Type", "application/json"], ["Accept", "application/json"], ["X-Correlation-ID", "SWAP_1795935600_3f9a2c7e51b04d18"], ["X-API-KEY", "$BANK_KEY"]]
        },
        "description": "the cash was paid out: close the code. answer `success`, `confirmed`, `transaction_reference` and `settlement_triggered`.",
        "security": [{"yourBankKey": []}],
        "parameters": [{"$ref": "#/components/parameters/CorrelationId"}],
        "requestBody": {"required": true, "content": {"application/json": {"examples": {"confirm": {"value": {"action": "CONFIRM_CASHOUT", "reference": "SWAP_1795935600_3f9a2c7e51b04d18", "voucher_number": "48213906", "amount": 200, "completed_at": "2026-11-29 10:02:41"}}}}}},
        "responses": {
          "200": {"description": "closed", "content": {"application/json": {"examples": {"confirmed": {"value": {"success": true, "confirmed": true, "transaction_reference": "ATM-20261129-000112", "settlement_triggered": false}}}}}},
          "4XX": {"$ref": "#/components/responses/BankRefusal"},
          "5XX": {"$ref": "#/components/responses/BankOutage"}
        }
      }
    },
    "bankReverse": {
      "post": {
        "operationId": "bankReverse",
        "summary": "bank: reverse",
        "tags": ["banks and mnos"],
        "x-group": "banks",
        "x-status": "live",
        "x-path": "/api/v1/reverse.php",
        "x-setting": "reverse (endpoints.common.reverse)",
        "x-rules": {"signed": "your key in your header", "clock": "at least 60 s to answer", "repeats": "same reference: reversed once"},
        "x-example-request": {
          "url": "https://test.yourbank.example/api/v1/reverse.php",
          "headers": [["Content-Type", "application/json"], ["Accept", "application/json"], ["X-Correlation-ID", "SWAP_1795935600_3f9a2c7e51b04d18"], ["X-API-KEY", "$BANK_KEY"]]
        },
        "description": "undo a movement that must not stand, by its reference. answer `success` and `status`.",
        "security": [{"yourBankKey": []}],
        "parameters": [{"$ref": "#/components/parameters/CorrelationId"}],
        "requestBody": {"required": true, "content": {"application/json": {"examples": {"reverse": {"value": {"reference": "SWAP_1795935600_3f9a2c7e51b04d18", "transaction_reference": "DEP-20261129-000877", "amount": 250, "currency": "BWP", "reason": "Reversed by VouchMorph"}}}}}},
        "responses": {
          "200": {"description": "reversed", "content": {"application/json": {"examples": {"reversed": {"value": {"success": true, "status": "REVERSED"}}}}}},
          "4XX": {"$ref": "#/components/responses/BankRefusal"},
          "5XX": {"$ref": "#/components/responses/BankOutage"}
        }
      }
    },
    "bankStatus": {
      "post": {
        "operationId": "bankStatus",
        "summary": "bank: status of a reference",
        "tags": ["banks and mnos"],
        "x-group": "banks",
        "x-status": "live",
        "x-path": "/api/v1/status",
        "x-setting": "status (endpoints.common.status)",
        "x-rules": {"signed": "your key in your header", "clock": "30 s to answer", "repeats": "a read: safe to repeat"},
        "x-example-request": {
          "url": "https://test.yourbank.example/api/v1/status",
          "headers": [["Content-Type", "application/json"], ["Accept", "application/json"], ["X-Correlation-ID", "SWAP_1795935600_3f9a2c7e51b04d18"], ["X-API-KEY", "$BANK_KEY"]]
        },
        "description": "what happened to a reference, when an answer was lost. the body is only the reference. answer `success` and the movement's `status`.",
        "security": [{"yourBankKey": []}],
        "parameters": [{"$ref": "#/components/parameters/CorrelationId"}],
        "requestBody": {"required": true, "content": {"application/json": {"examples": {"status": {"value": {"reference": "SWAP_1795935600_3f9a2c7e51b04d18"}}}}}},
        "responses": {
          "200": {"description": "the movement's status", "content": {"application/json": {"examples": {"found": {"value": {"success": true, "status": "COMPLETED", "reference": "SWAP_1795935600_3f9a2c7e51b04d18"}}}}}},
          "4XX": {"$ref": "#/components/responses/BankRefusal"},
          "5XX": {"$ref": "#/components/responses/BankOutage"}
        }
      }
    },
    "bankHealth": {
      "get": {
        "operationId": "bankHealth",
        "summary": "bank: health",
        "tags": ["banks and mnos"],
        "x-group": "banks",
        "x-status": "live",
        "x-path": "/health",
        "x-setting": "health (endpoints.common.health)",
        "x-rules": {"signed": "none", "clock": "answer within 10 s", "repeats": "a read: safe to repeat"},
        "x-example-request": {
          "url": "https://test.yourbank.example/health",
          "headers": [["Accept", "application/json"]]
        },
        "description": "is your test system up? named in your entry so staff can see it at a glance. no payment and no check connection depends on it: answer 200 with a small json body.",
        "responses": {
          "200": {"description": "up", "content": {"application/json": {"examples": {"up": {"value": {"status": "ok"}}}}}},
          "5XX": {"$ref": "#/components/responses/BankOutage"}
        }
      }
    },
    "settlementAdvice": {
      "post": {
        "operationId": "settlementAdvice",
        "summary": "bank: settlement advice",
        "tags": ["settlement"],
        "x-group": "settlement",
        "x-status": "live",
        "x-path": "/api/v1/settlement/advice.php",
        "x-setting": "settlement_advice (endpoints.common.settlement_advice)",
        "x-rules": {"signed": "vouchmorph's certificate: signature", "clock": "each settlement cycle", "repeats": "same advice_id: sent until you answer"},
        "x-example-request": {
          "url": "https://test.yourbank.example/api/v1/settlement/advice.php",
          "headers": [["Content-Type", "application/json"], ["Accept", "application/json"], ["X-API-KEY", "$BANK_KEY"]]
        },
        "description": "what your bank owes each receiving bank this cycle, with every payment behind each line. pay each line through the sandbox central bank with its `line_ref` as the `reference_code`, to `creditor_bank` and `creditor_account`. we send the same advice again until you answer `success: true`, up to 20 times.",
        "security": [{"yourBankKey": []}],
        "requestBody": {"required": true, "content": {"application/json": {"examples": {"advice": {"value": {"message_type": "SETTLEMENT_ADVICE", "advice_id": "ADV-2611291200-ORANGE", "debtor_bank": "ORANGE", "cycle_at": "2026-11-29T12:00:00+02:00", "due_by": "2026-11-30T12:00:00+02:00", "currency": "BWP", "total_amount": "500.00", "pay_via": "CENTRAL_BANK", "instructions": "Pay each line through the central bank using line_ref as reference_code, to creditor_bank / creditor_account.", "lines": [{"line_ref": "VMSL-1200-ORZU-1", "kind": "PRINCIPAL", "creditor_bank": "ZURUBANK", "creditor_account": "VMCLR-ZURUBANK", "amount": "500.00", "currency": "BWP", "items": [{"type": "SWAP", "reference": "SWAP_1795935600_3f9a2c7e51b04d18", "amount": "500.00"}]}], "timestamp": 1795946400, "signature": "<base64 rsa-sha256>", "requester": "VOUCHMORPH", "certificate": "-----BEGIN CERTIFICATE-----\n…\n-----END CERTIFICATE-----"}}}}}},
        "responses": {
          "200": {"description": "received", "content": {"application/json": {"examples": {"received": {"value": {"success": true, "message": "Advice received"}}}}}},
          "4XX": {"$ref": "#/components/responses/BankRefusal"},
          "5XX": {"$ref": "#/components/responses/BankOutage"}
        }
      }
    },
    "settlementCheck": {
      "post": {
        "operationId": "settlementCheck",
        "summary": "bank: did a line arrive?",
        "tags": ["settlement"],
        "x-group": "settlement",
        "x-status": "live",
        "x-path": "/api/v1/settlement/check.php",
        "x-setting": "check_settlement (endpoints.common.check_settlement)",
        "x-rules": {"signed": "vouchmorph's certificate: signature", "clock": "asked until it arrives", "repeats": "a read: safe to repeat"},
        "x-example-request": {
          "url": "https://test.yourbank.example/api/v1/settlement/check.php",
          "headers": [["Content-Type", "application/json"], ["Accept", "application/json"], ["X-Correlation-ID", "VMSL-1200-ORZU-1"], ["X-API-KEY", "$BANK_KEY"]]
        },
        "description": "asked of the receiving bank: did this settlement line arrive? answer `success`, `settled` and your `settlement_reference`. `status` FAILED, REJECTED or RETURNED marks the line failed; once settled, every payment on it is marked settled.",
        "security": [{"yourBankKey": []}],
        "parameters": [{"$ref": "#/components/parameters/CorrelationId"}],
        "requestBody": {"required": true, "content": {"application/json": {"examples": {"check": {"value": {"reference": "VMSL-1200-ORZU-1", "swap_references": ["SWAP_1795935600_3f9a2c7e51b04d18"], "timestamp": 1795950900, "signature": "<base64 rsa-sha256>", "requester": "VOUCHMORPH", "certificate": "-----BEGIN CERTIFICATE-----\n…\n-----END CERTIFICATE-----"}}}}}},
        "responses": {
          "200": {"description": "the line's state", "content": {"application/json": {"examples": {"settled": {"value": {"success": true, "settled": true, "settlement_reference": "CB-900000014", "status": "SETTLED"}}}}}},
          "4XX": {"$ref": "#/components/responses/BankRefusal"},
          "5XX": {"$ref": "#/components/responses/BankOutage"}
        }
      }
    },
    "cardAuthorize": {
      "post": {
        "operationId": "cardAuthorize",
        "summary": "card: authorize a hold",
        "tags": ["cards"],
        "x-group": "cards",
        "x-status": "live",
        "x-path": "/api/Authorize.php",
        "x-setting": "place_hold of a card acquirer (endpoints.source.place_hold)",
        "x-rules": {"signed": "vouchmorph's certificate: signature", "clock": "at least 60 s to answer", "repeats": "same reference: one authorization"},
        "x-example-request": {
          "url": "https://test.youracquirer.example/api/Authorize.php",
          "headers": [["Content-Type", "application/json"], ["Accept", "application/json"], ["X-Correlation-ID", "AUTH_6748a1f2c3d4e"], ["X-API-Key", "$ACQUIRER_KEY"]]
        },
        "description": "a hold on a card through your acquirer, as json over https. the card comes as a test card token (`card_token`, also `source_identifier`). answer `success`, `authorization_reference` and `authorization_code`, at the top or under `data`; no authorization reference counts as a decline. iso 8583 is the other way to carry it: see the iso 8583 link.",
        "security": [{"yourBankKey": []}],
        "parameters": [{"$ref": "#/components/parameters/CorrelationId"}],
        "requestBody": {"required": true, "content": {"application/json": {"examples": {"authorize": {"value": {"action": "AUTHORIZE", "reference": "AUTH_6748a1f2c3d4e", "amount": 250, "currency": "BWP", "card_token": "tok_test_4111", "source_identifier": "tok_test_4111", "expiry": "2026-12-06 09:12:44", "timestamp": 1795935600, "signature": "<base64 rsa-sha256>", "requester": "VOUCHMORPH", "certificate": "-----BEGIN CERTIFICATE-----\n…\n-----END CERTIFICATE-----"}}}}}},
        "responses": {
          "200": {"description": "authorized", "content": {"application/json": {"examples": {"authorized": {"value": {"success": true, "message": "Authorized", "data": {"authorization_reference": "AUTH-REF-55120", "authorization_code": "A1B2C3", "status": "ACTIVE"}}}}}}},
          "4XX": {"$ref": "#/components/responses/BankRefusal"},
          "5XX": {"$ref": "#/components/responses/BankOutage"}
        }
      }
    },
    "cardCapture": {
      "post": {
        "operationId": "cardCapture",
        "summary": "card: capture",
        "tags": ["cards"],
        "x-group": "cards",
        "x-status": "live",
        "x-path": "/api/Capture.php",
        "x-setting": "debit_funds of a card acquirer (endpoints.source.debit_funds)",
        "x-rules": {"signed": "vouchmorph's certificate: signature", "clock": "at least 60 s to answer", "repeats": "same authorization: one capture"},
        "x-example-request": {
          "url": "https://test.youracquirer.example/api/Capture.php",
          "headers": [["Content-Type", "application/json"], ["Accept", "application/json"], ["X-Correlation-ID", "CAPTURE_6748a1f2c3d4f"], ["X-API-Key", "$ACQUIRER_KEY"]]
        },
        "description": "take an authorized hold. there is no capture without an authorization reference. answer `success` and your `transaction_reference`.",
        "security": [{"yourBankKey": []}],
        "parameters": [{"$ref": "#/components/parameters/CorrelationId"}],
        "requestBody": {"required": true, "content": {"application/json": {"examples": {"capture": {"value": {"action": "CAPTURE", "reference": "CAPTURE_6748a1f2c3d4f", "authorization_reference": "AUTH-REF-55120", "amount": 250, "timestamp": 1795935660, "signature": "<base64 rsa-sha256>", "requester": "VOUCHMORPH", "certificate": "-----BEGIN CERTIFICATE-----\n…\n-----END CERTIFICATE-----"}}}}}},
        "responses": {
          "200": {"description": "captured", "content": {"application/json": {"examples": {"captured": {"value": {"success": true, "transaction_reference": "CAP-55120", "status": "COMPLETED"}}}}}},
          "4XX": {"$ref": "#/components/responses/BankRefusal"},
          "5XX": {"$ref": "#/components/responses/BankOutage"}
        }
      }
    },
    "cardVoid": {
      "post": {
        "operationId": "cardVoid",
        "summary": "card: void",
        "tags": ["cards"],
        "x-group": "cards",
        "x-status": "live",
        "x-path": "/api/Void.php",
        "x-setting": "release_hold of a card acquirer (endpoints.source.release_hold)",
        "x-rules": {"signed": "vouchmorph's certificate: signature", "clock": "at least 60 s to answer", "repeats": "same authorization: voided once"},
        "x-example-request": {
          "url": "https://test.youracquirer.example/api/Void.php",
          "headers": [["Content-Type", "application/json"], ["Accept", "application/json"], ["X-Correlation-ID", "VOID_6748a1f2c3d50"], ["X-API-Key", "$ACQUIRER_KEY"]]
        },
        "description": "give an authorized hold back. answer `success` and `status`.",
        "security": [{"yourBankKey": []}],
        "parameters": [{"$ref": "#/components/parameters/CorrelationId"}],
        "requestBody": {"required": true, "content": {"application/json": {"examples": {"void": {"value": {"action": "VOID", "reference": "VOID_6748a1f2c3d50", "authorization_reference": "AUTH-REF-55120", "reason": "Released by VouchMorph", "timestamp": 1795935700, "signature": "<base64 rsa-sha256>", "requester": "VOUCHMORPH", "certificate": "-----BEGIN CERTIFICATE-----\n…\n-----END CERTIFICATE-----"}}}}}},
        "responses": {
          "200": {"description": "voided", "content": {"application/json": {"examples": {"voided": {"value": {"success": true, "status": "VOIDED"}}}}}},
          "4XX": {"$ref": "#/components/responses/BankRefusal"},
          "5XX": {"$ref": "#/components/responses/BankOutage"}
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "courierSignature": {"type": "apiKey", "in": "header", "name": "x-courier-signature", "description": "sha256= plus the hex hmac-sha256 of \"<x-courier-timestamp>.<raw body>\", keyed with your signing secret"},
      "connectionKey": {"type": "http", "scheme": "bearer", "description": "your connection key, the one you sign in to the console with"},
      "settlementSignature": {"type": "apiKey", "in": "header", "name": "X-Signature", "description": "base64 signature of the raw body with the key of your sandbox certificate"},
      "centralBankHmac": {"type": "apiKey", "in": "header", "name": "Authorization", "description": "HMAC <BANK>:<hex hmac-sha256 of the raw body>, keyed with your bank's central bank secret"},
      "yourCourierKey": {"type": "apiKey", "in": "header", "name": "Authorization", "description": "your test api key, in the header you named on the connection page, after its prefix (for example Bearer )"},
      "yourBankKey": {"type": "apiKey", "in": "header", "name": "X-API-KEY", "description": "how we sign in to your test system, as your connection says: an api key in the header you name, oauth2 client credentials or mutual tls"}
    },
    "headers": {
      "RequestId": {"description": "our id for this request: quote it when you ask about a call", "schema": {"type": "string", "pattern": "^[0-9a-f]{16}$"}}
    },
    "parameters": {
      "CorrelationId": {"name": "X-Correlation-ID", "in": "header", "required": false, "description": "the body's reference, when it has one", "schema": {"type": "string"}}
    },
    "responses": {
      "MalformedUpdate": {"description": "malformed_update: not json, a field missing, occurredAt not a time or status not a status word", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Envelope"}, "examples": {"malformed_update": {"value": {"success": false, "error": {"code": "malformed_update", "message": "The update's eventId is missing", "request_id": "5f0c1e9a7b3d2468"}, "data": null}}}}}},
      "UpdateNotSigned": {"description": "bad_signature: no signature or a wrong one; stale_update: signed more than 5 minutes from now", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Envelope"}, "examples": {"bad_signature": {"value": {"success": false, "error": {"code": "bad_signature", "message": "The update's signature is wrong", "request_id": "5f0c1e9a7b3d2468"}, "data": null}}, "stale_update": {"value": {"success": false, "error": {"code": "stale_update", "message": "The update was signed more than 5 minutes from now", "request_id": "5f0c1e9a7b3d2468"}, "data": null}}}}}},
      "UnknownCourier": {"description": "unknown_courier: no courier has this id; not_found: no such route", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Envelope"}, "examples": {"unknown_courier": {"value": {"success": false, "error": {"code": "unknown_courier", "message": "No courier has this id.", "request_id": "5f0c1e9a7b3d2468"}, "data": null}}}}}},
      "MethodNotAllowed": {"description": "method_not_allowed: the Allow header names the method", "headers": {"Allow": {"description": "the method this route takes", "schema": {"type": "string"}}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Envelope"}, "examples": {"method_not_allowed": {"value": {"success": false, "error": {"code": "method_not_allowed", "message": "Send the update with POST."}, "data": null}}}}}},
      "PayloadTooLarge": {"description": "payload_too_large: the body is over 65536 bytes", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Envelope"}, "examples": {"payload_too_large": {"value": {"success": false, "error": {"code": "payload_too_large", "message": "The body is larger than 65536 bytes.", "request_id": "5f0c1e9a7b3d2468"}, "data": null}}}}}},
      "InternalError": {"description": "internal_error: something went wrong at vouchmorph; send it again", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Envelope"}, "examples": {"internal_error": {"value": {"success": false, "error": {"code": "internal_error", "message": "Something went wrong at VouchMorph. Send the update again.", "request_id": "5f0c1e9a7b3d2468"}, "data": null}}}}}},
      "CourierUnavailable": {"description": "courier_not_configured: this courier is not set up at vouchmorph yet; courier_unavailable: your track endpoint could not be read, so send the update again", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Envelope"}, "examples": {"courier_unavailable": {"value": {"success": false, "error": {"code": "courier_unavailable", "message": "The courier's tracking could not be read. Send the update again.", "request_id": "5f0c1e9a7b3d2468"}, "data": null}}, "courier_not_configured": {"value": {"success": false, "error": {"code": "courier_not_configured", "message": "This courier is not set up at VouchMorph yet.", "request_id": "5f0c1e9a7b3d2468"}, "data": null}}}}}},
      "YourRefusal": {"description": "your refusal: we keep your own error code when the body has a lowercase `code` (for example not_found), else http_<status>, and do not retry it as it is", "content": {"application/json": {"examples": {"refused": {"value": {"code": "already_dropped_off", "message": "The parcel is already at the counter."}}}}}},
      "YourOutage": {"description": "a 5xx, no answer in 30 s or an answer that is not json: courier_unavailable, tried again later", "content": {"application/json": {"examples": {"outage": {"value": {"code": "temporarily_unavailable"}}}}}},
      "BankRefusal": {"description": "a refusal: the call failed, with your `message` shown to staff. say why in `message`", "content": {"application/json": {"examples": {"refused": {"value": {"success": false, "message": "Insufficient funds"}}}}}},
      "BankOutage": {"description": "a 5xx: failed. a 502 or 504, a timeout after the request left or a cut-short answer is an unknown outcome: never sent again, confirmed with you later", "content": {"application/json": {"examples": {"outage": {"value": {"success": false, "message": "Service unavailable"}}}}}}
    },
    "schemas": {
      "Envelope": {
        "type": "object",
        "description": "every vouchmorph answer on the sandbox host: success, error and data",
        "required": ["success", "error", "data"],
        "properties": {
          "success": {"type": "boolean"},
          "error": {
            "type": ["object", "null"],
            "properties": {
              "code": {"type": "string"},
              "message": {"type": "string"},
              "request_id": {"type": "string"}
            }
          },
          "data": {}
        }
      },
      "CourierUpdate": {
        "type": "object",
        "required": ["eventId", "courierReference", "clientReference", "occurredAt", "status"],
        "properties": {
          "eventId": {"type": "string", "maxLength": 128, "description": "unique per update"},
          "courierReference": {"type": "string", "maxLength": 200, "description": "your reference"},
          "clientReference": {"type": "string", "maxLength": 200, "description": "our VM- reference"},
          "occurredAt": {"type": "string", "maxLength": 200, "description": "iso 8601 time"},
          "status": {"type": "string", "pattern": "^[a-z][a-z0-9_]{0,39}$", "description": "your status word"},
          "place": {"type": ["string", "null"], "maxLength": 500},
          "note": {"type": ["string", "null"], "maxLength": 500}
        }
      },
      "CourierUpdateAnswer": {
        "type": "object",
        "required": ["success", "error", "data"],
        "properties": {
          "success": {"type": "boolean", "const": true},
          "error": {"type": "null"},
          "data": {
            "type": "object",
            "properties": {
              "eventId": {"type": "string"},
              "status": {"type": "string", "description": "your word, as your track endpoint gave it"},
              "signal": {"type": ["string", "null"], "description": "our signal for your word; null when your status words do not have it"},
              "gated": {"type": "boolean", "description": "true when the parcel belongs to a payment held for you"},
              "outcome": {"type": ["string", "null"], "enum": ["condition_met", "condition_not_met", "locked", "condition_failed", null]},
              "repeated": {"type": "boolean"}
            }
          }
        }
      },
      "Problem": {
        "type": "object",
        "description": "rfc 9457 problem details, with the iso 20022 reason code",
        "required": ["type", "title", "status"],
        "properties": {
          "type": {"type": "string"},
          "title": {"type": "string"},
          "status": {"type": "integer"},
          "detail": {"type": "string"},
          "code": {"type": "string", "description": "the iso 20022 reason code, e.g. FF01, AM05, RC01, AM02"}
        }
      },
      "SettlementAccepted": {
        "type": "object",
        "required": ["status", "reference", "payment_id"],
        "properties": {
          "status": {"type": "string", "description": "queued, or settled for a payment sent again after it settled"},
          "reference": {"type": "string"},
          "payment_id": {"type": "integer", "description": "the sandbox central bank's transfer id"},
          "settles_in_window": {"type": "string", "description": "the clearing window it settles in, iso 8601 in botswana time"},
          "duplicate": {"type": "boolean", "description": "true on the same payment sent again"},
          "format": {"type": "string", "enum": ["pacs.009", "MT202"]},
          "message": {"type": "string"}
        }
      },
      "CentralBankInstruction": {
        "type": "object",
        "required": ["sender_bank_code", "sender_account", "recipient_bank_code", "recipient_account", "amount", "reference_code", "timestamp"],
        "properties": {
          "sender_bank_code": {"type": "string", "description": "your bank: the one in the Authorization header"},
          "sender_account": {"type": "string", "pattern": "^[A-Za-z0-9._-]{1,40}$"},
          "recipient_bank_code": {"type": "string", "description": "a member bank, not your own"},
          "recipient_account": {"type": "string", "pattern": "^[A-Za-z0-9._-]{1,40}$"},
          "amount": {"type": ["number", "string"], "description": "pula, positive, at most two decimals, at most 10000000"},
          "reference_code": {"type": "string", "pattern": "^[A-Za-z0-9._:-]{1,64}$"},
          "origin_transaction_id": {"type": "string", "maxLength": 64},
          "origin_callback_url": {"type": "string", "maxLength": 500, "description": "kept for your records; notices go to your registered address, never this one"},
          "timestamp": {"type": ["integer", "string"], "description": "unix seconds, within 5 minutes"}
        }
      },
      "CentralBankAnswer": {
        "type": "object",
        "required": ["success", "status"],
        "properties": {
          "success": {"type": "boolean"},
          "status": {"type": "string", "description": "queued, settled, rejected ..."},
          "duplicate": {"type": "boolean"},
          "transfer_id": {"type": "integer"},
          "reference_code": {"type": "string"},
          "settles_in_window": {"type": "string"},
          "code": {"type": ["string", "null"], "description": "iso 20022 reason code: FF01, RC01, AM02, AM05, DT01"},
          "message": {"type": "string"}
        }
      }
    }
  }
}
