| Status | Draft. |
| Version | 0.1.0, 2026-11-28 |
| Profile of | JWS (RFC 7515) compact serialization with detached content (Appendix F), signed with EdDSA over Ed25519 (RFC 8037). Otherwise none: an OCI protocol |
| Depends on | OCI-0 Core, OCI-1 Trust Registry, OCI-PAY-1 Payment Addressing |
| Used by | OCI-PAY-3 Payment Apps, OCI-PAY-4 Switch Link |
| Reference implementation | ocipay-api (the switch), ocipay-bank-api (a bank’s connector) |
1. Purpose
OCI-Pay is an instant payment rail. Each country has one payments switch, run by its national payments operator. The banks of that country connect to it. The switch finds who an address belongs to, moves a payment from the payer’s bank to the payee’s bank, carries requests for money, and keeps the positions the banks settle later.
OCI-PAY-2 is the protocol between a bank and its switch. It also defines what every machine-to-machine call on the rail shares: the participant registry, the OCI-Signature header, idempotency, money and errors. OCI-PAY-3 (payment apps) and OCI-PAY-4 (the link between two switches) cite those clauses and do not repeat them.
OCI-PAY-2 does not define:
- address syntax, who owns a handle, or how an address issued by a payment app is resolved (OCI-PAY-1);
- what a payment app calls on the switch, the home-switch rule,
/v1/relay, or what the switch calls on a payment app (OCI-PAY-3); - the
/link/v1/*calls, cross-border pricing and foreign exchange (OCI-PAY-4); - a bank’s own customer channel, PIN storage or core banking. They sit behind the connector and are not on the rail.
2. Roles
| Role | Registry kind | Does |
|---|---|---|
| Switch | switch | One per country. Routes payments and requests for money between the country’s banks, keeps positions, runs settlement cycles. Linked to the other country’s switch (OCI-PAY-4). |
| Bank | bank | Holds accounts. Runs a connector that serves the calls in §8 and makes the calls in §7. Talks only to its own country’s switch. |
| Provider | provider | A payment app. Holds no accounts. Uses the switch under OCI-PAY-3. |
| Identity provider | idp | Listed in the registry. Not called on the rail. |
| Trust registry | none | Lists the participants and where their keys are (§3). |
3. Participants and trust
The rail trusts the participant list of the trust registry service (ocitrust, GET /v1/participants). It does not resolve OCI-1 entity statements or trust marks. See §18.
- SW-3.1 Each participant record MUST carry
id,kind,country,display_name,address_suffix,base_url,jwks_urlandstatus, and MAY carryacts_for(OCI-PAY-3).kindis one ofbank,switch,provider,idp.statusisactiveorsuspended.countryis an ISO 3166-1 alpha-2 code in upper case. Anidpmay have none. - SW-3.2 Participant ids are compared as exact strings. A bank’s id is
bank:<code>, a provider’sprovider:<code>, and a switch’s MUST beswitch:<CC>where<CC>is its country: switches read a peer’s country from its id. - SW-3.3 Each country MUST have exactly one participant of kind
switch. A bank’scountrynames the one switch it uses. - SW-3.4
address_suffixis the handle of the addresses a bank or provider issues (OCI-PAY-1). Readers MUST lower-case it and strip a leading@. No two participants may share one. - SW-3.5
base_urlis where the participant serves its rail endpoints, without a trailing path. Callers MUST build request URLs from it, and receivers MUST checkhtuagainst it (SW-4.7). A switch MAY be configured with a different URL for its peer. - SW-3.6
jwks_urlis the participant’s JWK Set of signing keys. Every bank and switch serves its own at/.well-known/jwks.json, without authentication. A registry used for tests or offline running MAY carry the keys inline asjwks. - SW-3.7 A participant whose
statusis notactiveMUST NOT be accepted as the sender of a call (SW-4.9), and the switch MUST NOT route a payment or a request for money to a handle it owns. - SW-3.8 Readers MAY cache the participant list for up to 60 seconds. If the registry cannot be reached, the switch MAY keep using the last list it fetched. With no list at all, the call fails (SW-4.15).
4. OCI-Signature
Every call between participants is signed by the sender. The signature covers the method, the URL and the exact body bytes.
- SW-4.1 Every request between participants (bank to switch, switch to bank, provider to switch, switch to provider, switch to switch) MUST carry an
OCI-Signatureheader. Only/.well-known/jwks.jsonand/healthare served without one. - SW-4.2 The header value MUST be a compact JWS with detached content (RFC 7515 Appendix F):
<b64url(protected header)>..<b64url(signature)>, with an empty middle part. A value with three non-empty parts (an attached payload) MUST be rejected. The RFC 7797 unencoded-payload variant is not used. - SW-4.3 The signing input MUST be
b64url(protected header) + "." + b64url(body), where body is the exact request body bytes as sent, and is empty for aGET.b64urlis base64url without padding. - SW-4.4
algMUST beEdDSA, with an Ed25519 key (RFC 8037:ktyOKP,crvEd25519). Verifiers MUST reject every otheralg, includingnone, and every other key type. This is an exception to CORE-5.1 and CORE-5.2 (§18). - SW-4.5 The protected header MUST carry exactly these members:
alg,kid(string),iss(string),iat(integer NumericDate),htm(string),htu(string). Verifiers MUST reject a header that lacks one or gives it the wrong JSON type. The header carries notyp. This is an exception to CORE-5.4 (§18). - SW-4.6
issMUST be the sender’s participant id (SW-3.2). - SW-4.7
htmMUST equal the request method.htuMUST equal the receiver’s base URL followed by the request path, with no query string. Verifiers MUST comparehtuas an exact string with their own base URL plus the path they received, and reject a mismatch. - SW-4.8 Verifiers MUST reject a signature whose
iatis more than 120 seconds before or after their clock (SIGNATURE_EXPIRED). There is nojtiand no replay cache. Repeats of state-changing calls are handled by idempotency (§5). - SW-4.9 Verifiers MUST look
issup in the registry and reject it unless it is anactiveparticipant (UNKNOWN_PARTICIPANT). - SW-4.10 Verifiers MUST then check that this kind of participant may call this endpoint, and answer
403if not:- the switch’s
/v1/*calls: abankorproviderwhosecountryis the switch’s own; - the switch’s
/link/v1/*calls: theswitchof another country (OCI-PAY-4); - a bank’s
/switch/v1/*calls: onlyswitch:<CC>of the bank’s own country, of kindswitch.
- the switch’s
- SW-4.11 Verifiers MUST take the sender’s keys only from its registry record (
jwks_url, or inlinejwks). They MUST NOT use a key or key URL carried in the request. The signature is valid when a key whosekidequals the header’skidverifies it. - SW-4.12 Verifiers MAY cache a sender’s JWK Set. The reference caches it for 300 seconds. When no cached key verifies the signature, the verifier MUST fetch the JWK Set again, once, bypassing the cache, before it rejects the call. This is how a rotated key is picked up. A verifier MAY refuse to refetch more often than once every 30 seconds per sender.
- SW-4.13 A sender MUST publish a key at its
jwks_urlbefore it signs with it. - SW-4.14 The switch MUST verify the signature before it parses the body, and a signature error MUST be returned in preference to a body validation error.
- SW-4.15 If the registry or the sender’s JWK Set cannot be fetched, the verifier MUST refuse the call with a
5xxerror, never accept it. - SW-4.16 Responses are not signed. A caller relies on TLS to the
base_urlit took from the registry for the authenticity of the answer.
5. Idempotency
The switch makes state-changing calls repeat-safe with an Idempotency-Key header. A bank’s connector makes the calls it serves repeat-safe on the payment or request id instead.
- SW-5.1 The switch MUST require an
Idempotency-Keyheader onPOST /v1/payments,POST /v1/collect-requestsandPOST /v1/settlement/cycles, and answer400 IDEMPOTENCY_KEY_REQUIREDwithout one. It MUST accept, and MAY be sent, a key onPOST /v1/quotesandPOST /v1/collect-requests/{id}/status. Lookups and reads take none. - SW-5.2 A key MUST be at most 200 characters (
400 IDEMPOTENCY_KEY_INVALID). A bank’s connector uses the payment id, or the request id, as the key. - SW-5.3 A key is scoped to the caller’s participant id and the request path. The same key from another caller, or on another path, is a different key.
- SW-5.4 The switch MUST store, with the key, the SHA-256 of the exact body bytes. A repeat whose body differs MUST be refused with
422 IDEMPOTENCY_KEY_REUSED. Senders MUST therefore send the same bytes when they repeat a call. - SW-5.5 A repeat that arrives while the first call is still running MUST be refused with
409 REQUEST_IN_PROGRESS. A claim left with no result for 120 seconds is treated as abandoned, and the next repeat runs the call again. - SW-5.6 A repeat of a call that succeeded MUST return the first result. One exception: when the stored result is a payment whose
stateisreceivedorcredited, the switch MUST try to move that payment forward (§9) and return its current record instead. - SW-5.7 If a call fails with an error, the switch MUST NOT keep the key. A repeat runs the call again. Errors are not replayed.
- SW-5.8 The switch sends
Idempotency-Key, set to the payment id, onPOST /switch/v1/credit. A bank’s connector MUST credit a payment id at most once whether or not the header is present, and MUST hold, capture or release a payment id at most once (§8). - SW-5.9 Answers that mean “I already have this” are not refusals:
409 REQUEST_IN_PROGRESS,409 PAYMENT_ID_TAKENand422 IDEMPOTENCY_KEY_REUSED. A caller MUST treat them as an unknown outcome (§10), not as a failure.
6. Money and identifiers
- SW-6.1 Money is a JSON object
{ "value": "<decimal string>", "currency": "<code>" }.valueMUST be a string, never a JSON number. - SW-6.2 The currencies are
INRandUSD, each with two minor digits. Each switch has one currency, its country’s:INusesINRandUSusesUSD. A switch MUST refuse any other code with422 UNKNOWN_CURRENCY. A bank’s connector refuses a body it cannot read as SW-13.2 says (422 VALIDATION_ERROR). - SW-6.3 An amount sent to the switch MUST match
^\d{1,12}(\.\d{1,2})?$and be greater than zero (422 INVALID_AMOUNT). A bank’s connector accepts at most 10 integer digits and at most 10,000,000.00 per amount. - SW-6.4 Amounts the switch sends always have exactly two decimals. Only settlement nets (§12) may be negative, with a leading
-. - SW-6.5 Implementations MUST hold amounts as integer minor units. Where an amount is converted (OCI-PAY-4) it is rounded half-even to minor units.
- SW-6.6 Payment ids, request-for-money ids and quote ids are UUIDs in their textual form. A bank MAY choose the id of a payment or request it starts. Otherwise the switch chooses one.
- SW-6.7 Times in bodies (
created_at,expires_at,completed_at) are RFC 3339 date-times with an offset. Only the signature’siatis a NumericDate. - SW-6.8 The switch lower-cases every address it receives and rejects one that is not
name@handle, is longer than 200 characters or contains white space. OCI-PAY-1 owns the syntax. - SW-6.9 A
noteMUST be at most 140 characters. - SW-6.10 Bodies are UTF-8 JSON (
Content-Type: application/json). Receivers MUST ignore members they do not know.
7. The switch API for banks
All calls in this section are signed by the bank (§4). A successful call answers 200. A payment that ends failed is a 200 too: the failure is in the body.
The switch knows which addresses a caller may speak for: those under its own address_suffix. OCI-PAY-3 adds the addresses a payment app may speak for.
7.1 Look up an address
POST /v1/lookup with { "address": "<address>" }.
- SW-7.1 The switch MUST route the address by its handle (OCI-PAY-1). For an address held at a bank in its own country it MUST ask that bank (
POST /switch/v1/lookup, SW-8.1). For an address in the other country it asks the peer switch (OCI-PAY-4). For an address a provider issued, OCI-PAY-1 and OCI-PAY-3 apply. - SW-7.2 The answer MUST be
{ address, name, verified, bank_name, country, assurance, cross_border }.cross_borderistruewhen the account is in the other country.bank_namefalls back to the bank’s registrydisplay_name.nameandassuranceare never null: a bank’s (or the peer switch’s) answer without them is not an answer (SW-7.3). - SW-7.3 An address with no account MUST answer
404 ADDRESS_NOT_FOUND. If the bank did not answer, the switch MUST answer503 BANK_UNAVAILABLE, and503 PEER_UNAVAILABLEfor the peer switch. Any other non-success reply from the bank is reported as404 ADDRESS_NOT_FOUND.
POST /v1/lookup Look up an address · served by the switch
Returns who holds an address, so the payer can confirm the name before paying. Called by a bank of the switch's country. Defined in SW-7.1, SW-7.2, SW-7.3.
| Request | Type | Required | Meaning | Clause |
|---|---|---|---|---|
address | string | yes | The address to look up, as name@handle. (at most 200 characters) | SW-6.8 |
| Response | Type | Required | Meaning | Clause |
|---|---|---|---|---|
address | string | yes | The address looked up, lower-cased. (at most 200 characters) | SW-6.8 |
name | string | yes | The account holder's name. | |
verified | boolean | yes | Whether the name comes from a checked identity. | |
bank_name | string | yes | The bank that holds the account; the switch falls back to its registry display_name. | SW-7.2 |
country | string | yes | The ISO 3166-1 alpha-2 country of the account. (pattern ^[A-Z]{2}$) | |
assurance | "low" | "substantial" | "high" | yes | How strongly the holder's identity was checked (CORE-4). | SW-8.1 |
cross_border | boolean | yes | True when the account is in the other country. | SW-7.2 |
Errors
7.2 Quote a cross-border payment
POST /v1/quotes with { from_address?, to_address, amount }.
- SW-7.4 Quotes are only for an address in the other country. A domestic
to_addressMUST answer422 NOT_CROSS_BORDER. Afrom_address, when given, MUST be one the caller speaks for (403 ADDRESS_NOT_OWNED). - SW-7.5 The answer MUST be
{ quote_id, send, receive, rate, fee, total_debit, expires_at }.sendis in the switch’s currency,receivein the other country’s.feeis the switch’s fixed link fee in its own currency: INR 20.00 atIN, USD 1.62 atUS.total_debitissend + fee.rateis a string with two decimals. Pricing is OCI-PAY-4. - SW-7.6 A quote MUST be held for 600 seconds, MUST be usable by one payment only, and only by the participant that asked for it.
POST /v1/quotes Quote a cross-border payment · served by the switch
Prices a payment to an address in the other country and holds that price for 600 seconds. Called by a bank of the switch's country. Defined in SW-7.4, SW-7.5, SW-7.6.
| Request | Type | Required | Meaning | Clause |
|---|---|---|---|---|
from_address | string | The payer's address; when given, it must be one the caller speaks for. (at most 200 characters) | SW-7.4 | |
to_address | string | yes | The payee's address, in the other country. (at most 200 characters) | SW-7.4 |
amount | object | yes | What the payer sends, in the switch's currency. | SW-6.1 |
amount.value | string | yes | A decimal string greater than zero, such as "250.00". Never a JSON number. (pattern ^\d{1,12}(\.\d{1,2})?$) | SW-6.3 |
amount.currency | "INR" | "USD" | yes | The ISO 4217 code: INR or USD. | SW-6.2 |
| Response | Type | Required | Meaning | Clause |
|---|---|---|---|---|
quote_id | string, uuid | yes | The quote's id, to send with the payment. | SW-6.6 |
send | object | yes | What the payer's side sends, in the switch's currency. | SW-7.5 |
send.value | string | yes | A decimal string with exactly two decimals, such as "250.00". Never a JSON number. (pattern ^\d+\.\d{2}$) | SW-6.4 |
send.currency | "INR" | "USD" | yes | The ISO 4217 code: INR or USD. | SW-6.2 |
receive | object | yes | What the payee receives, in the other country's currency. | SW-7.5 |
receive.value | string | yes | A decimal string with exactly two decimals, such as "250.00". Never a JSON number. (pattern ^\d+\.\d{2}$) | SW-6.4 |
receive.currency | "INR" | "USD" | yes | The ISO 4217 code: INR or USD. | SW-6.2 |
rate | string | yes | The exchange rate, as a string with two decimals. (pattern ^\d+\.\d{2}$) | SW-7.5 |
fee | object | yes | The switch's fixed link fee, in its own currency. | SW-7.5 |
fee.value | string | yes | A decimal string with exactly two decimals, such as "250.00". Never a JSON number. (pattern ^\d+\.\d{2}$) | SW-6.4 |
fee.currency | "INR" | "USD" | yes | The ISO 4217 code: INR or USD. | SW-6.2 |
total_debit | object | yes | What leaves the payer's account: send plus fee. | SW-7.5 |
total_debit.value | string | yes | A decimal string with exactly two decimals, such as "250.00". Never a JSON number. (pattern ^\d+\.\d{2}$) | SW-6.4 |
total_debit.currency | "INR" | "USD" | yes | The ISO 4217 code: INR or USD. | SW-6.2 |
expires_at | string, date-time | yes | When the quote stops being usable, 600 seconds after it was made. | SW-7.6 |
Errors
7.3 Send a payment
POST /v1/payments with Idempotency-Key and { id?, from_address, from_name?, to_address, amount, note?, quote_id?, collect_request_id? }. The members payer and credential are for providers only (OCI-PAY-3).
When a bank sends a payment, the bank has already checked its customer’s PIN and set the money aside. The switch only credits the payee.
- SW-7.7
from_addressMUST be one the caller speaks for (403 ADDRESS_NOT_OWNED).to_addressMUST differ from it (422 SELF_PAYMENT).amountMUST be in the switch’s currency (422 CURRENCY_MISMATCH) and is the principal, without the fee. - SW-7.8 A bank’s payment MUST NOT carry
payerorcredential(422 PAYER_NOT_ALLOWED). The switch does not call/switch/v1/debitfor it. - SW-7.9 A domestic payment MUST NOT carry a
quote_id(422 QUOTE_NOT_ALLOWED). A cross-border payment MUST carry one (422 QUOTE_REQUIRED). The quote MUST exist and belong to the caller (404 QUOTE_NOT_FOUND), be unused (409 QUOTE_USED) and unexpired (410 QUOTE_EXPIRED). The payment’samountMUST equal the quote’ssend, itsto_addressthe quote’s, and itsfrom_addressthe quote’s when the quote named one (422 QUOTE_MISMATCH). The bank sets aside the quote’stotal_debit. - SW-7.10 A payment with
collect_request_idpays that request (§11). The request MUST name the caller’s side as payer (404 REQUEST_NOT_FOUND), the same two addresses and the same amount in the payee’s currency (422 REQUEST_MISMATCH), bependingorapprovedwith no payment attached (409 REQUEST_NOT_PAYABLE), and be unexpired (410 REQUEST_EXPIRED). - SW-7.11 An
idthe switch already holds for another payment MUST be refused with409 PAYMENT_ID_TAKEN. - SW-7.12 The switch MUST record the payment, claim the quote and the request, and then run it (§9) before it answers. The answer is the payment record (SW-7.13), with
statuscompleted,failedorpending. - SW-7.13 A payment record is
{ id, status, state, failure_reason, direction, from_address, to_address, to_name, amount, receive, fee, rate, note, collect_request_id, created_at, completed_at }.statusis what a bank acts on:pending(statereceivedorcredited),completed,failedorreversed.stateis the switch’s state (§9).directionisdomestic,outboundorinbound.receive,feeandrateare set for cross-border payments only.
POST /v1/payments Send a payment · served by the switch
Records a payment the bank has already set the money aside for, credits the payee and answers the payment record. Called by a bank of the switch's country. Defined in SW-5.1, SW-7.7, SW-7.8, SW-7.9, SW-7.10, SW-7.11, SW-7.12, SW-7.13.
| Request | Type | Required | Meaning | Clause |
|---|---|---|---|---|
id | string, uuid | The payment id the bank chose; the switch chooses one when absent. | SW-6.6 | |
from_address | string | yes | The payer's address; it must be one the caller speaks for. (at most 200 characters) | SW-7.7 |
from_name | string | The payer's name, as the bank holds it. | ||
to_address | string | yes | The payee's address; it must differ from from_address. (at most 200 characters) | SW-7.7 |
amount | object | yes | The principal, in the switch's currency, without the fee. | SW-7.7 |
amount.value | string | yes | A decimal string greater than zero, such as "250.00". Never a JSON number. (pattern ^\d{1,12}(\.\d{1,2})?$) | SW-6.3 |
amount.currency | "INR" | "USD" | yes | The ISO 4217 code: INR or USD. | SW-6.2 |
note | string | Free text from the payer, at most 140 characters. (at most 140 characters) | SW-6.9 | |
quote_id | string, uuid | The quote this payment uses: required for a cross-border payment, refused for a domestic one. | SW-7.9 | |
collect_request_id | string, uuid | The request for money this payment pays. | SW-7.10 | |
payer | object | For providers only (OCI-PAY-3): the account the money leaves. A bank must not send it. | SW-7.8, PSP-11.1, PSP-11.2 | |
payer.bank | string | yes | The registry id of the bank that holds the account, such as bank:sbi. | |
payer.account | string | yes | The account reference that bank gave the provider. | |
credential | string | For providers only (OCI-PAY-3): the PIN as a JWE to the bank's key. A bank must not send it. A new PIN message for this payment (PSP-8.6); payment apps only. (at most 4000 characters) | SW-7.8, PSP-11.1, PSP-8.6 |
| Response | Type | Required | Meaning | Clause |
|---|---|---|---|---|
id | string, uuid | yes | The payment id. | SW-6.6 |
status | "pending" | "completed" | "failed" | "reversed" | yes | What a bank acts on: pending while the state is received or credited. | SW-7.13 |
state | "received" | "credited" | "completed" | "failed" | "reversed" | yes | The switch's own state of the payment. | SW-9.1 |
failure_reason | string, null | yes | Why the payment failed: the refusal's code, or one the switch sets. | SW-9.3 |
direction | "domestic" | "outbound" | "inbound" | yes | Whether the payment stays in the country, leaves it, or came from the other country. | SW-7.13 |
from_address | string | yes | The payer's address. (at most 200 characters) | SW-6.8 |
to_address | string | yes | The payee's address. (at most 200 characters) | SW-6.8 |
to_name | string, null | yes | The payee's name, when the payee's side gave one. | |
amount | object | yes | The principal, in the switch's currency, without the fee. | SW-7.7 |
amount.value | string | yes | A decimal string with exactly two decimals, such as "250.00". Never a JSON number. (pattern ^\d+\.\d{2}$) | SW-6.4 |
amount.currency | "INR" | "USD" | yes | The ISO 4217 code: INR or USD. | SW-6.2 |
receive | object, null | yes | What the payee receives, in the other country's currency; set for cross-border payments only. | SW-7.13 |
fee | object, null | yes | The link fee in the switch's currency; set for cross-border payments only. | SW-7.13 |
rate | string, null | yes | The exchange rate with two decimals; set for cross-border payments only. | SW-7.13 |
note | string, null | yes | Free text from the payer, at most 140 characters. (at most 140 characters) | SW-6.9 |
collect_request_id | string, null, uuid | yes | The request for money this payment pays, if any. | SW-7.10 |
created_at | string, date-time | yes | When the switch recorded the payment. | SW-6.7 |
completed_at | string, null, date-time | yes | When the payment completed, once it has. | SW-6.7 |
Errors
403 ADDRESS_NOT_OWNED(SW-7.7)422 SELF_PAYMENT(SW-7.7)422 CURRENCY_MISMATCH(SW-7.7)422 PAYER_NOT_ALLOWED(PSP-11.2)422 QUOTE_NOT_ALLOWED(PSP-11.8)422 QUOTE_REQUIRED(SW-7.9)404 QUOTE_NOT_FOUND(SW-7.9)409 QUOTE_USED(SW-7.9)410 QUOTE_EXPIRED(SW-7.9)422 QUOTE_MISMATCH(SW-7.9)404 REQUEST_NOT_FOUND(SW-7.10)422 REQUEST_MISMATCH(SW-7.10)409 REQUEST_NOT_PAYABLE(SW-7.10)410 REQUEST_EXPIRED(SW-7.10)409 PAYMENT_ID_TAKEN(SW-7.11)422 UNKNOWN_CURRENCY(SW-6.2)422 INVALID_AMOUNT(SW-6.3)400 IDEMPOTENCY_KEY_REQUIRED(SW-5.1)400 IDEMPOTENCY_KEY_INVALID(SW-5.2)422 IDEMPOTENCY_KEY_REUSED(SW-5.4)409 REQUEST_IN_PROGRESS(SW-5.5)422 PAYER_REQUIRED(PSP-11.2)422 PAYER_BANK_UNKNOWN(PSP-11.3)422 WRONG_SWITCH(PSP-11.3)
7.4 Read a payment
GET /v1/payments/{id}, signed over the empty body.
- SW-7.14 The switch MUST return the record of a payment only to a participant that is its payer bank, its payee participant, or the provider that started it. Anyone else MUST get
404 PAYMENT_NOT_FOUND, the same answer as for an unknown id. - SW-7.15 A read MUST NOT move the payment forward. To move it forward the bank repeats the
POST(SW-5.6, SW-10.5).
GET /v1/payments/{payment_id} Read a payment · served by the switch
Returns the current record of a payment the caller is a party to, without moving it forward. Called by a bank of the switch's country. Defined in SW-7.14, SW-7.15, SW-10.4.
Request: no body.
| Response | Type | Required | Meaning | Clause |
|---|---|---|---|---|
id | string, uuid | yes | The payment id. | SW-6.6 |
status | "pending" | "completed" | "failed" | "reversed" | yes | What a bank acts on: pending while the state is received or credited. | SW-7.13 |
state | "received" | "credited" | "completed" | "failed" | "reversed" | yes | The switch's own state of the payment. | SW-9.1 |
failure_reason | string, null | yes | Why the payment failed: the refusal's code, or one the switch sets. | SW-9.3 |
direction | "domestic" | "outbound" | "inbound" | yes | Whether the payment stays in the country, leaves it, or came from the other country. | SW-7.13 |
from_address | string | yes | The payer's address. (at most 200 characters) | SW-6.8 |
to_address | string | yes | The payee's address. (at most 200 characters) | SW-6.8 |
to_name | string, null | yes | The payee's name, when the payee's side gave one. | |
amount | object | yes | The principal, in the switch's currency, without the fee. | SW-7.7 |
amount.value | string | yes | A decimal string with exactly two decimals, such as "250.00". Never a JSON number. (pattern ^\d+\.\d{2}$) | SW-6.4 |
amount.currency | "INR" | "USD" | yes | The ISO 4217 code: INR or USD. | SW-6.2 |
receive | object, null | yes | What the payee receives, in the other country's currency; set for cross-border payments only. | SW-7.13 |
fee | object, null | yes | The link fee in the switch's currency; set for cross-border payments only. | SW-7.13 |
rate | string, null | yes | The exchange rate with two decimals; set for cross-border payments only. | SW-7.13 |
note | string, null | yes | Free text from the payer, at most 140 characters. (at most 140 characters) | SW-6.9 |
collect_request_id | string, null, uuid | yes | The request for money this payment pays, if any. | SW-7.10 |
created_at | string, date-time | yes | When the switch recorded the payment. | SW-6.7 |
completed_at | string, null, date-time | yes | When the payment completed, once it has. | SW-6.7 |
Errors
404 PAYMENT_NOT_FOUND(SW-7.14)
7.5 Ask for money
POST /v1/collect-requests with Idempotency-Key and { id?, payee_address, payee_name?, payee_assurance?, payer_address, amount, note?, expires_at? }. The caller is the payee’s side.
- SW-7.16
payee_addressMUST be one the caller speaks for (403 ADDRESS_NOT_OWNED) and differ frompayer_address(422 SELF_REQUEST).amountMUST be in the switch’s currency (422 CURRENCY_MISMATCH). - SW-7.17
expires_atdefaults to 24 hours after the request is made. It MUST be in the future and no more than 30 days ahead (422 INVALID_EXPIRY). Anidalready in use MUST be refused with409 REQUEST_ID_TAKEN. - SW-7.18 The switch MUST deliver the request before it answers: to the payer’s bank (SW-8.7), to the peer switch when the payer is in the other country (OCI-PAY-4), or to the provider that issued the payer’s address (OCI-PAY-3). If the payer’s bank has its own app (OCI-PAY-3), the app gets a copy too.
- SW-7.19 If delivery fails, the switch MUST delete the request and answer:
503 DELIVERY_FAILEDwhen the other side did not answer,404 PAYER_NOT_FOUNDwhen it answered 404,422 REQUEST_REJECTEDfor any other refusal. - SW-7.20 The answer is
{ id, status, payee_address, payer_address, amount, expires_at }, withstatuspending.
POST /v1/collect-requests Ask for money · served by the switch
Records a request for money and delivers it to the payer's side before answering; no money moves. Called by the payee's bank. Defined in SW-5.1, SW-7.16, SW-7.17, SW-7.18, SW-7.19, SW-7.20.
| Request | Type | Required | Meaning | Clause |
|---|---|---|---|---|
id | string, uuid | The request id the bank chose; the switch chooses one when absent. | SW-7.17 | |
payee_address | string | yes | The address asking for money; it must be one the caller speaks for. (at most 200 characters) | SW-7.16 |
payee_name | string | The payee's name, passed to the payer as sent. | ||
payee_assurance | "low" | "substantial" | "high" | How strongly the payee's identity was checked, passed to the payer as sent. | ||
payer_address | string | yes | The address asked to pay; it must differ from payee_address. (at most 200 characters) | SW-7.16 |
amount | object | yes | The amount asked for, in the switch's currency. | SW-7.16 |
amount.value | string | yes | A decimal string greater than zero, such as "250.00". Never a JSON number. (pattern ^\d{1,12}(\.\d{1,2})?$) | SW-6.3 |
amount.currency | "INR" | "USD" | yes | The ISO 4217 code: INR or USD. | SW-6.2 |
note | string | Free text from the payee, at most 140 characters. (at most 140 characters) | SW-6.9 | |
expires_at | string, date-time | When the request stops being payable: in the future, at most 30 days ahead, 24 hours by default. | SW-7.17 |
| Response | Type | Required | Meaning | Clause |
|---|---|---|---|---|
id | string, uuid | yes | The request id. | SW-6.6 |
status | "pending" | yes | Always pending: the request was delivered and not yet answered. | SW-7.20 |
payee_address | string | yes | The address asking for money. (at most 200 characters) | SW-6.8 |
payer_address | string | yes | The address asked to pay. (at most 200 characters) | SW-6.8 |
amount | object | yes | The amount asked for, in the switch's currency. | SW-6.1 |
amount.value | string | yes | A decimal string with exactly two decimals, such as "250.00". Never a JSON number. (pattern ^\d+\.\d{2}$) | SW-6.4 |
amount.currency | "INR" | "USD" | yes | The ISO 4217 code: INR or USD. | SW-6.2 |
expires_at | string, date-time | yes | When the request stops being payable. | SW-7.17 |
Errors
403 ADDRESS_NOT_OWNED(SW-7.16)422 SELF_REQUEST(SW-7.16)422 CURRENCY_MISMATCH(SW-7.16)422 INVALID_EXPIRY(SW-7.17)409 REQUEST_ID_TAKEN(SW-7.17)503 DELIVERY_FAILED(SW-7.19)404 PAYER_NOT_FOUND(SW-7.19)422 REQUEST_REJECTED(SW-7.19)422 UNKNOWN_CURRENCY(SW-6.2)422 INVALID_AMOUNT(SW-6.3)400 IDEMPOTENCY_KEY_REQUIRED(SW-5.1)400 IDEMPOTENCY_KEY_INVALID(SW-5.2)422 IDEMPOTENCY_KEY_REUSED(SW-5.4)409 REQUEST_IN_PROGRESS(SW-5.5)
7.6 Answer or withdraw a request
POST /v1/collect-requests/{id}/status with { status, report? }.
- SW-7.21
statusMUST beapproved,declined,cancelledorexpired(422 INVALID_STATUS). Only the switch setspaid(SW-11.4).reportis kept only withdeclined: the payer reports the request as unwanted. - SW-7.22 The caller MUST be a party to the request (
404 REQUEST_NOT_FOUND). The payer’s side MAY movependingtoapproved, andpendingorapprovedtodeclined. The payee’s side MAY movependingorapprovedtocancelled. Either side MAY setexpiredonceexpires_athas passed. When one participant is on both sides,cancelledis taken as the payee speaking and any other status as the payer. - SW-7.23 Setting the status the request already has MUST succeed and change nothing, with
relayed: false. - SW-7.24 A refused change answers
409:REQUEST_BEING_PAIDfordeclined,cancelledorexpiredwhile a payment is attached,REQUEST_CLOSEDwhen the request is already closed,NOT_ALLOWEDotherwise.approvedafterexpires_atanswers410 REQUEST_EXPIRED. - SW-7.25 The switch MUST pass the new status to the other party (SW-8.8) and answer
{ id, status, relayed }.relayedsays whether the other party accepted it. A failed relay does not undo the change. - SW-7.26 Approving a request does not pay it. The payer’s bank pays it with a payment that names it (SW-7.10).
POST /v1/collect-requests/{request_id}/status Answer or withdraw a request · served by the switch
The payer's side approves or declines a request, the payee's side cancels it, and either marks it expired. Called by the payer's or the payee's bank. Defined in SW-7.21, SW-7.22, SW-7.23, SW-7.24, SW-7.25, SW-7.26.
| Request | Type | Required | Meaning | Clause |
|---|---|---|---|---|
status | "approved" | "declined" | "cancelled" | "expired" | yes | The new status; only the switch sets paid. | SW-7.21 |
report | boolean | With declined only: the payer reports the request as unwanted. | SW-7.21 |
| Response | Type | Required | Meaning | Clause |
|---|---|---|---|---|
id | string, uuid | yes | The request id. | SW-6.6 |
status | "approved" | "declined" | "cancelled" | "expired" | yes | The status the request now has. | |
relayed | boolean | yes | Whether the other party accepted the new status; false when nothing changed. | SW-7.25 |
Errors
8. Calls the switch makes on a bank
A bank’s connector serves these under /switch/v1 at its base_url. All are POST, signed by the switch (§4), and answer 200 on success.
- SW-8.1
POST /switch/v1/lookupwith{ address }. The bank MUST answer{ address, name, verified, bank_name, country, assurance, cross_border }for one of its own accounts, or404 ADDRESS_NOT_FOUND.assuranceislow,substantialorhigh(CORE-4). The bank MUST NOT answer for its internal accounts.
POST /switch/v1/lookup Look up one of the bank's addresses · served by a bank
Returns the holder of one of the bank's own customer addresses, never an internal account. Called by the switch of the bank's own country. Defined in SW-8.1, SW-7.1.
| Request | Type | Required | Meaning | Clause |
|---|---|---|---|---|
address | string | yes | The address to look up. (at most 200 characters) | SW-6.8 |
| Response | Type | Required | Meaning | Clause |
|---|---|---|---|---|
address | string | yes | The address looked up, lower-cased. (at most 200 characters) | SW-6.8 |
name | string | yes | The account holder's name. | |
verified | boolean | yes | Whether the name comes from a checked identity. | |
bank_name | string | yes | The bank that holds the account; the switch falls back to its registry display_name. | SW-7.2 |
country | string | yes | The ISO 3166-1 alpha-2 country of the account. (pattern ^[A-Z]{2}$) | |
assurance | "low" | "substantial" | "high" | yes | How strongly the holder's identity was checked (CORE-4). | SW-8.1 |
cross_border | boolean | yes | True when the account is in the other country. | SW-7.2 |
Errors
404 ADDRESS_NOT_FOUND(SW-8.1)
- SW-8.2
POST /switch/v1/creditwithIdempotency-Keyand{ "payment": { id, from_address, from_name, to_address, amount, fx, note, collect_request_id, created_at, to_account?, from_country? } }.amountis in the payee’s currency.fxisnullfor a domestic payment, else{ rate, send, receive }.to_accountis set when a provider issuedto_address: it is the reference the bank gave that provider (OCI-PAY-3).from_countryis set for a payment from the other country. - SW-8.3 The bank MUST credit the account and answer
{ "status": "credited", "id": "<payment id>" }, or refuse with a4xxerror:404 ADDRESS_NOT_FOUND, or422 CURRENCY_MISMATCHwhen the account is in another currency. The bank MUST credit a payment id at most once and MUST answer a repeat as it answered the first. The switch also accepts a2xxwhosestatusisfailedorrejectedas a refusal, with an optionalfailure_reason, and an optionalpayee_namewith a credit.
POST /switch/v1/credit Credit the payee · served by a bank
Credits the account behind the payee's address, at most once per payment id. Called by the switch of the bank's own country. Defined in SW-8.2, SW-8.3, SW-5.8.
| Request | Type | Required | Meaning | Clause |
|---|---|---|---|---|
payment | object | yes | The payment as the switch describes it to the payee's bank. | |
payment.id | string, uuid | yes | The payment id; the bank credits it at most once. | SW-5.8 |
payment.from_address | string | yes | The payer's address. (at most 200 characters) | SW-6.8 |
payment.from_name | string, null | yes | The payer's name, as the payer's side gave it. | |
payment.to_address | string | yes | The payee's address. (at most 200 characters) | SW-6.8 |
payment.amount | object | yes | The amount to credit, in the payee's currency. | SW-8.2 |
payment.amount.value | string | yes | A decimal string with exactly two decimals, such as "250.00". Never a JSON number. (pattern ^\d+\.\d{2}$) | SW-6.4 |
payment.amount.currency | "INR" | "USD" | yes | The ISO 4217 code: INR or USD. | SW-6.2 |
payment.fx | object, null | yes | Null for a domestic payment, else the rate and both sides' amounts. | SW-8.2 |
payment.note | string, null | yes | Free text from the payer, at most 140 characters. (at most 140 characters) | SW-6.9 |
payment.collect_request_id | string, null, uuid | yes | The request for money this payment pays, if any. | SW-6.6 |
payment.created_at | string, date-time | yes | When the switch recorded the payment. | SW-6.7 |
payment.to_account | string | Set when a provider issued to_address: the reference the bank gave that provider. | SW-8.2 | |
payment.from_country | string | Set for a payment from the other country: the payer's country. (pattern ^[A-Z]{2}$) | SW-8.2 |
| Response | Type | Required | Meaning | Clause |
|---|---|---|---|---|
status | "credited" | "failed" | "rejected" | yes | credited when the bank credited the account; the switch also takes failed or rejected as a refusal. | SW-8.3 |
id | string, uuid | yes | The payment id. | SW-6.6 |
failure_reason | string | Optional, with failed or rejected: why the credit was refused. | SW-8.3 | |
payee_name | string | Optional, with a credit: the payee's name. | SW-8.3 |
Errors
- SW-8.4
POST /switch/v1/debitwith{ "payment": { id, account, provider, from_address, to_address, to_name, to_country, amount, fee, fx, note }, "pin": "<JWE>" | null }. The switch sends it only for a payment a provider started (OCI-PAY-3). The bank MUST check thatprovidermay use the accountaccountnames (403 PROVIDER_NOT_ALLOWED), check the PIN, and set asideamountplusfee. It answers{ id, status, failure_reason }withstatusheld. - SW-8.5 The debit is repeat-safe on the payment id. A repeat MUST answer what the bank already did, whether or not it carries a PIN:
held,capturedorreleased. The same id for another account MUST answer409 PAYMENT_ID_TAKEN. A call with no PIN for an id the bank never held MUST answer404 DEBIT_NOT_FOUND. Refusals:422 CURRENCY_MISMATCH,422 INSUFFICIENT_FUNDS, and the PIN errors of §13.
POST /switch/v1/debit Hold the payer's money · served by a bank
For a payment a provider started, checks the provider and the PIN and sets amount plus fee aside. Called by the switch of the bank's own country. Defined in SW-8.4, SW-8.5, SW-9.6, SW-9.8.
| Request | Type | Required | Meaning | Clause |
|---|---|---|---|---|
payment | object | yes | The payment as the switch describes it to the payer's bank. | |
payment.id | string, uuid | yes | The payment id; the debit is repeat-safe on it. | SW-8.5 |
payment.account | string | yes | The account reference the bank gave the provider. | SW-8.4 |
payment.provider | string | yes | The registry id of the provider that started the payment. | SW-8.4 |
payment.from_address | string | yes | The payer's address at the provider. (at most 200 characters) | SW-6.8 |
payment.to_address | string | yes | The payee's address. (at most 200 characters) | SW-6.8 |
payment.to_name | string, null | yes | The payee's name, when known. | |
payment.to_country | string | yes | The payee's country. (pattern ^[A-Z]{2}$) | |
payment.amount | object | yes | The principal, in the payer's currency. | SW-6.1 |
payment.amount.value | string | yes | A decimal string with exactly two decimals, such as "250.00". Never a JSON number. (pattern ^\d+\.\d{2}$) | SW-6.4 |
payment.amount.currency | "INR" | "USD" | yes | The ISO 4217 code: INR or USD. | SW-6.2 |
payment.fee | object, null | yes | The link fee for a cross-border payment, else null. | SW-6.1 |
payment.fx | object, null | yes | Null for a domestic payment, else the rate and both sides' amounts. | |
payment.note | string, null | yes | Free text from the payer, at most 140 characters. (at most 140 characters) | SW-6.9 |
pin | string, null | yes | The PIN as a compact JWE to the bank's PIN key, sent on the first debit only; null on a later attempt. | SW-9.8 |
| Response | Type | Required | Meaning | Clause |
|---|---|---|---|---|
id | string, uuid | yes | The payment id. | SW-6.6 |
status | "held" | "captured" | "released" | yes | What the bank has done with the money for this payment id. | SW-8.5 |
failure_reason | string, null | yes | Why the money was released, when it was. |
Errors
- SW-8.6
POST /switch/v1/debit/{id}/capturewith{}takes the held money.POST /switch/v1/debit/{id}/releasewith{ reason }gives it back. Both answer{ id, status, failure_reason }, and404 DEBIT_NOT_FOUNDwhen the bank holds nothing for that id. The first of the two to arrive wins. A later call of either kind answers the outcome that stands.
POST /switch/v1/debit/{payment_id}/capture Take the held money · served by a bank
Once the payment completed, turns the hold into a debit; the first of capture and release wins. Called by the switch of the bank's own country. Defined in SW-8.6, SW-9.7.
| Request | Type | Required | Meaning | Clause |
|---|
| Response | Type | Required | Meaning | Clause |
|---|---|---|---|---|
id | string, uuid | yes | The payment id. | SW-6.6 |
status | "held" | "captured" | "released" | yes | What the bank has done with the money for this payment id. | SW-8.5 |
failure_reason | string, null | yes | Why the money was released, when it was. |
Errors
404 DEBIT_NOT_FOUND(SW-8.6)
POST /switch/v1/debit/{payment_id}/release Give the held money back · served by a bank
Once the payment failed, drops the hold so the money is free again; the first of capture and release wins. Called by the switch of the bank's own country. Defined in SW-8.6, SW-9.7.
| Request | Type | Required | Meaning | Clause |
|---|---|---|---|---|
reason | string | yes | Why the payment failed: its failure_reason. | SW-8.6 |
| Response | Type | Required | Meaning | Clause |
|---|---|---|---|---|
id | string, uuid | yes | The payment id. | SW-6.6 |
status | "held" | "captured" | "released" | yes | What the bank has done with the money for this payment id. | SW-8.5 |
failure_reason | string, null | yes | Why the money was released, when it was. |
Errors
404 DEBIT_NOT_FOUND(SW-8.6)
- SW-8.7
POST /switch/v1/collect-requestswith{ "request": { id, payee_address, payee_name, payee_assurance, payee_country, payer_address, amount, note, expires_at, created_at } }delivers a request for money to the payer’s bank.amountis in the payee’s currency. The bank MUST answer{ id, status },404 ADDRESS_NOT_FOUNDfor an unknown payer, or422 REQUEST_EXPIREDifexpires_athas passed. A repeat of the same id MUST NOT create a second request.
POST /switch/v1/collect-requests Deliver a request for money · served by a bank
Delivers a request for money to the payer's bank, which keeps one copy per request id. Called by the switch of the bank's own country. Defined in SW-8.7.
| Request | Type | Required | Meaning | Clause |
|---|---|---|---|---|
request | object | yes | The request as the switch describes it to the payer's bank. | |
request.id | string, uuid | yes | The request id; a repeat must not create a second request. | SW-8.7 |
request.payee_address | string | yes | The address asking for money. (at most 200 characters) | SW-6.8 |
request.payee_name | string, null | yes | The payee's name, as the payee's side sent it. | |
request.payee_assurance | "low" | "substantial" | "high" | "null" | yes | How strongly the payee's identity was checked, as the payee's side sent it. | |
request.payee_country | string | yes | The payee's country. (pattern ^[A-Z]{2}$) | |
request.payer_address | string | yes | The bank's address asked to pay. (at most 200 characters) | SW-6.8 |
request.amount | object | yes | The amount asked for, in the payee's currency. | SW-8.7 |
request.amount.value | string | yes | A decimal string with exactly two decimals, such as "250.00". Never a JSON number. (pattern ^\d+\.\d{2}$) | SW-6.4 |
request.amount.currency | "INR" | "USD" | yes | The ISO 4217 code: INR or USD. | SW-6.2 |
request.note | string, null | yes | Free text from the payee, at most 140 characters. (at most 140 characters) | SW-6.9 |
request.expires_at | string, date-time | yes | When the request stops being payable. | SW-6.7 |
request.created_at | string, date-time | yes | When the switch recorded the request. | SW-6.7 |
| Response | Type | Required | Meaning | Clause |
|---|---|---|---|---|
id | string, uuid | yes | The request id. | SW-6.6 |
status | "pending" | "approved" | "declined" | "cancelled" | "expired" | "paid" | yes | The status of the bank's copy of the request. |
Errors
- SW-8.8
POST /switch/v1/collect-requests/{id}/statuswith{ status, report?, side? }tells a bank how a request moved.statusisapproved,declined,cancelled,expiredorpaid. The switch sends it to the other party of a status change (SW-7.25), sendspaidto the payee’s side when a payment for the request completes, and sendsside: "payer"to the payer’s bank when the bank’s own app answered the request (OCI-PAY-3). The bank answers{ id, status }, or404 REQUEST_NOT_FOUND.
POST /switch/v1/collect-requests/{request_id}/status A request for money moved · served by a bank
Tells a bank the new status of a request it made or received. Called by the switch of the bank's own country. Defined in SW-8.8, SW-7.25, SW-9.5.
| Request | Type | Required | Meaning | Clause |
|---|---|---|---|---|
status | "approved" | "declined" | "cancelled" | "expired" | "paid" | yes | The request's new status. | SW-8.8 |
report | boolean | Passed on with declined: the payer reported the request as unwanted. | SW-7.21 | |
side | "payer" | Sent to the payer's bank when the bank's own app answered the request (OCI-PAY-3). | SW-8.8 |
| Response | Type | Required | Meaning | Clause |
|---|---|---|---|---|
id | string, uuid | yes | The request id. | SW-6.6 |
status | "pending" | "approved" | "declined" | "cancelled" | "expired" | "paid" | yes | The status of the bank's copy of the request. |
Errors
404 REQUEST_NOT_FOUND(SW-8.8)
- SW-8.9 A bank’s connector also serves
/switch/v1/connect/accounts,/switch/v1/connect/link,/switch/v1/connect/unlinkand/switch/v1/balance, which the switch calls for a provider. OCI-PAY-3 defines them.
9. Payment states
A payment at the switch has a state and, if a provider started it, a debit_state.
state | Meaning |
|---|---|
received | Recorded. The payee has not been credited. |
credited | The payee’s bank, or the peer switch, has accepted the credit. |
completed | Final. Positions are written. |
failed | Final. Nobody was credited. |
reversed | Reserved. Nothing produces it in this version. |
- SW-9.1 A payment starts
received. It MAY movereceivedtocreditedorfailed, andcreditedtocompleted. No other move is allowed.completedandfailedare final. - SW-9.2 The switch MUST move
receivedtocreditedonly when the credit was accepted: a2xxfrom the payee’s bank that is not a refusal (SW-8.3), or for a cross-border payment a link answer ofcompleted(OCI-PAY-4). - SW-9.3 The switch MUST move
receivedtofailedonly on a definite refusal (SW-10.2). Thefailure_reasonis the refusal’s error code orfailure_reason. On failure the switch MUST free the quote (it may be used again) and the request for money (it may be paid again). - SW-9.4 The switch MUST move
creditedtocompletedand write the payment’s positions (§12) in one transaction. It MUST NOT complete a payment whose positions do not sum to zero in each currency. - SW-9.5 After a domestic or inbound payment completes, the switch tells the provider behind the payee’s address, if there is one (OCI-PAY-3). After any payment for a request completes, it marks the request
paidand, when the payee’s side is in its own country, tells it (SW-8.8). Across the link the peer switch tells its own side (OCI-PAY-4). Both are best effort and do not change the payment. - SW-9.6 For a payment a provider started,
debit_statestarts empty. The switch MUST ask the payer’s bank to hold the money (SW-8.4) before it credits anyone, and MUST setdebit_statetoheldbefore it moves on. A refused debit fails the payment. - SW-9.7 Once such a payment is
completedthe switch MUST capture the held money, and once it isfailedit MUST release it (SW-8.6).debit_statebecomescapturedorreleasedonly when the bank answers2xx. Until then it staysheldand the next attempt (SW-10.5) sends it again. - SW-9.8 The switch MUST NOT keep the PIN of a provider’s payment. It is passed to the bank in the first debit and dropped. A later attempt sends no PIN and the bank answers only what it already did (SW-8.5).
10. Timeouts, retries and unknown outcomes
- SW-10.1 The switch waits at most 4 seconds for a bank or a provider and 7 seconds for the peer switch. A bank’s connector waits at most 10 seconds for the switch.
- SW-10.2 The switch MUST sort every reply to a money-moving call into one of three kinds. Ok: a
2xx. Refused: a4xx, except the three answers of SW-5.9. Unknown: a timeout, a transport error, a5xx, or one of the answers of SW-5.9. Only a refusal may fail a payment. An unknown outcome MUST leave the payment where it is. - SW-10.3 A bank’s connector MUST treat the switch’s answer the same way, and in addition MUST treat every
409, a408and a429as unknown. Oncompletedit takes the money it set aside, onfailed(orreversed) it gives it back, and on anything else it keeps it set aside. - SW-10.4 On an unknown answer that says the switch already has the payment, the connector SHOULD read the payment (
GET /v1/payments/{id}) and act on itsstatus. - SW-10.5 The switch has no timer of its own. A payment stuck in
receivedorcredited, or with adebit_stateofheldafter it ended, moves forward only when: the bank repeats thePOST /v1/paymentswith the same key and body (SW-5.6), the peer switch repeats a link payment (OCI-PAY-4), or an operator callsPOST /v1/payments/{id}/retry. - SW-10.6 A bank’s connector MUST keep checking each payment it sent that is still pending. The reference checks every 5 seconds: it reads the payment, and if the switch has no record (
404) or still sayspending, it repeats thePOSTwith the same body and key, at most once every 30 seconds per payment and not before the payment is 30 seconds old. It MUST NOT post a payment a provider started; it only reads it. - SW-10.7 A repeat of a credit, debit, capture or release with the same payment id MUST NOT move money twice (SW-5.8).
11. Requests for money
status | Meaning |
|---|---|
pending | Delivered, not answered. |
approved | The payer’s side said yes. Not yet paid. |
declined | The payer’s side said no. Final. |
cancelled | The payee’s side withdrew it. Final. |
expired | Past expires_at, and a party said so. Final. |
paid | A payment for it completed. Final. |
- SW-11.1 A request keeps the same id at every participant that holds a copy, on both switches.
- SW-11.2 At most one payment can be attached to a request at a time. A failed payment frees it (SW-9.3).
- SW-11.3 The switch does not expire requests on its own.
expiredis set by a party (SW-7.22). A payment for a request pastexpires_atis refused (SW-7.10). - SW-11.4 The switch MUST set
paidwhen a payment that names the request completes, in the same transaction as the positions. - SW-11.5 A request is never needed to receive money.
12. Positions and settlement
Each switch records what it owes each participant and what each owes it. Settlement nets these. Moving the money itself (for example over a central bank’s settlement system) is outside OCI-PAY-2.
- SW-12.1 The switch MUST write one position row per movement when a payment completes. A position is a participant, a currency and a signed amount in minor units. Positive means the switch owes the participant.
- SW-12.2 The rows for one payment MUST sum to zero in each currency. They are, for an amount
xand feef:- domestic: payer’s bank
-x, payee’s bank+x; - outbound: payer’s bank
-xand-f,link:<peer country>+x,fees:<own country>+f; - inbound: payee’s bank
+y(the amount received),link:<peer country>-y.
- domestic: payer’s bank
- SW-12.3 For a payment a provider started, the payer is the bank that holds the account. Providers hold no positions.
- SW-12.4 A settlement cycle MUST take every open position row, mark it settled by that cycle, and return the net per participant and currency, in one transaction. It answers
{ id, status, created_at, payments_settled, banks, link, fees, balanced }, where each entry is{ participant, net, direction }andlinkalso carriespeerandequivalent(the net in the peer’s currency at the fixed rate).directionisswitch_pays_bank,bank_pays_switch,switch_owes_peer,peer_owes_switch,fee_income,fee_reversalorflat.balancedistruewhen the nets sum to zero in each currency. - SW-12.5 A cycle with no open positions MUST answer
409 NOTHING_TO_SETTLE. A position row belongs to exactly one cycle. - SW-12.6 Cycles are started by an operator (
POST /v1/settlement/cycles, withIdempotency-Key). Open positions are read withGET /v1/settlement/positionsand past cycles withGET /v1/settlement/cycles. These operator calls take a bearer admin token or a signed-in operator’s OCI-ID token, not anOCI-Signature. No bank calls them.
POST /v1/settlement/cycles Run a settlement cycle · served by the switch
Settles every open position row in one transaction and returns the net per participant and currency. Called by an operator, with a bearer admin token or an OCI-ID sign-in. Defined in SW-12.4, SW-12.5, SW-12.6, SW-5.1.
Request: no body.
| Response | Type | Required | Meaning | Clause |
|---|---|---|---|---|
id | string, uuid | yes | The cycle id. | SW-6.6 |
status | "settled" | yes | The cycle's status. | |
created_at | string, date-time | yes | When the cycle ran. | SW-6.7 |
payments_settled | integer | yes | How many payments' positions the cycle settled. | |
banks | array of object | yes | The net for each bank. | SW-12.4 |
banks[].participant | string | yes | The participant id, or link:<CC> or fees:<CC>. | |
banks[].net | object | yes | The participant's net; positive means the switch owes it. | SW-6.4 |
banks[].net.value | string | yes | A decimal string with exactly two decimals; settlement nets may be negative. (pattern ^-?\d+\.\d{2}$) | SW-6.4 |
banks[].net.currency | "INR" | "USD" | yes | The ISO 4217 code: INR or USD. | SW-6.2 |
banks[].direction | "switch_pays_bank" | "bank_pays_switch" | "switch_owes_peer" | "peer_owes_switch" | "fee_income" | "fee_reversal" | "flat" | yes | Which way the net is owed. | SW-12.4 |
link | object, null | yes | The net with the peer switch, or null when there is none. | |
fees | array of object | yes | The switch's fee income, per currency. | SW-12.4 |
fees[].participant | string | yes | The participant id, or link:<CC> or fees:<CC>. | |
fees[].net | object | yes | The participant's net; positive means the switch owes it. | SW-6.4 |
fees[].net.value | string | yes | A decimal string with exactly two decimals; settlement nets may be negative. (pattern ^-?\d+\.\d{2}$) | SW-6.4 |
fees[].net.currency | "INR" | "USD" | yes | The ISO 4217 code: INR or USD. | SW-6.2 |
fees[].direction | "switch_pays_bank" | "bank_pays_switch" | "switch_owes_peer" | "peer_owes_switch" | "fee_income" | "fee_reversal" | "flat" | yes | Which way the net is owed. | SW-12.4 |
balanced | boolean | yes | True when the nets sum to zero in each currency. | SW-12.4 |
Errors
13. Errors
- SW-13.1 Every error body MUST be
{ "error": { "code": "<CODE>", "message": "<one plain sentence>" } }with the matching HTTP status.codeis upper-caseSNAKE_CASE, and callers branch on it. This differs from CORE-9.1 (§18). - SW-13.2 A malformed body MUST answer
422 VALIDATION_ERROR, after the signature check (SW-4.14). - SW-13.3 Messages MUST NOT contain a PIN, a token, or another person’s data.
Codes the switch answers to banks:
| Status | Codes |
|---|---|
| 400 | IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID |
| 401 | SIGNATURE_REQUIRED, SIGNATURE_INVALID, SIGNATURE_EXPIRED, UNKNOWN_PARTICIPANT |
| 403 | FORBIDDEN, ADDRESS_NOT_OWNED |
| 404 | ADDRESS_NOT_FOUND, PAYMENT_NOT_FOUND, QUOTE_NOT_FOUND, REQUEST_NOT_FOUND, PAYER_NOT_FOUND |
| 409 | REQUEST_IN_PROGRESS, PAYMENT_ID_TAKEN, REQUEST_ID_TAKEN, QUOTE_USED, REQUEST_NOT_PAYABLE, REQUEST_BEING_PAID, REQUEST_CLOSED, NOT_ALLOWED, NOTHING_TO_SETTLE |
| 410 | QUOTE_EXPIRED, REQUEST_EXPIRED |
| 422 | VALIDATION_ERROR, INVALID_ADDRESS, UNKNOWN_CURRENCY, INVALID_AMOUNT, AMOUNT_TOO_SMALL, CURRENCY_MISMATCH, SELF_PAYMENT, SELF_REQUEST, NOT_CROSS_BORDER, QUOTE_REQUIRED, QUOTE_NOT_ALLOWED, QUOTE_MISMATCH, REQUEST_MISMATCH, IDEMPOTENCY_KEY_REUSED, INVALID_EXPIRY, INVALID_STATUS, REQUEST_REJECTED, PAYER_NOT_ALLOWED |
| 502 | PEER_REJECTED |
| 503 | TRUST_UNAVAILABLE, BANK_UNAVAILABLE, PEER_UNAVAILABLE, PROVIDER_UNAVAILABLE, DELIVERY_FAILED, PARTICIPANT_UNKNOWN |
Codes a bank’s connector answers to the switch:
| Status | Codes |
|---|---|
| 400 | PIN_INVALID, PIN_EXPIRED, PIN_REPLAYED |
| 401 | SIGNATURE_MISSING, SIGNATURE_INVALID, SIGNATURE_EXPIRED, UNKNOWN_PARTICIPANT |
| 403 | FORBIDDEN_PARTICIPANT, PROVIDER_NOT_ALLOWED, WRONG_PIN |
| 404 | ADDRESS_NOT_FOUND, DEBIT_NOT_FOUND, REQUEST_NOT_FOUND |
| 409 | PAYMENT_ID_TAKEN |
| 422 | VALIDATION_ERROR, CURRENCY_MISMATCH, INSUFFICIENT_FUNDS, REQUEST_EXPIRED |
| 423 | PIN_LOCKED |
| 502 | TRUST_REGISTRY_UNAVAILABLE, CORE_UNAVAILABLE |
A failed payment’s failure_reason is the code of the refusal that failed it (either table), a failure_reason from a 2xx refusal, or one the switch sets: CREDIT_REJECTED, PEER_FAILED, PAYEE_PARTICIPANT_UNKNOWN, PAYER_BANK_UNKNOWN, DEBIT_CLOSED, FAILED.
14. Worked example
Asha (asha@kestrel, at bank:kestrel) pays Ravi (ravi@heron, at bank:heron) INR 500.00 in country IN. The switch is switch:IN at https://switch.in.example, Heron’s connector is at https://pay.heron.example. Signatures are shortened.
Registry entries used:
[
{ "id": "bank:kestrel", "kind": "bank", "country": "IN", "display_name": "Kestrel Bank", "address_suffix": "kestrel",
"base_url": "https://pay.kestrel.example", "jwks_url": "https://pay.kestrel.example/.well-known/jwks.json", "status": "active", "acts_for": null },
{ "id": "bank:heron", "kind": "bank", "country": "IN", "display_name": "Heron Bank", "address_suffix": "heron",
"base_url": "https://pay.heron.example", "jwks_url": "https://pay.heron.example/.well-known/jwks.json", "status": "active", "acts_for": null },
{ "id": "switch:IN", "kind": "switch", "country": "IN", "display_name": "India Switch", "address_suffix": null,
"base_url": "https://switch.in.example", "jwks_url": "https://switch.in.example/.well-known/jwks.json", "status": "active", "acts_for": null }
]
1. Kestrel looks the payee up. POST https://switch.in.example/v1/lookup, body {"address":"ravi@heron"}. The switch asks Heron with POST https://pay.heron.example/switch/v1/lookup and the same body, signed as switch:IN. Heron answers, and the switch passes it on:
{ "address": "ravi@heron", "name": "Ravi Menon", "verified": true, "bank_name": "Heron Bank",
"country": "IN", "assurance": "high", "cross_border": false }
2. Kestrel checks Asha’s PIN, sets INR 500.00 aside, and sends the payment. Protected header of its signature, decoded:
{ "alg": "EdDSA", "kid": "q7Hc2LkVx0RmT9aB", "iss": "bank:kestrel", "iat": 1795860000, "htm": "POST",
"htu": "https://switch.in.example/v1/payments" }
POST /v1/payments
OCI-Signature: eyJhbGciOiJFZERTQSIsImtpZCI6InE3SGMyTGtWeDBSbVQ5YUIi...In0..mF3k...Q2Bg
Idempotency-Key: 3f0b6c1e-8a4d-4c2b-9e71-5d2a8f6b0c94
Content-Type: application/json
{ "id": "3f0b6c1e-8a4d-4c2b-9e71-5d2a8f6b0c94", "from_address": "asha@kestrel", "from_name": "Asha Rao",
"from_country": "IN", "to_address": "ravi@heron", "amount": { "value": "500.00", "currency": "INR" },
"note": "Dinner", "quote_id": null, "collect_request_id": null }
The switch ignores from_country (SW-6.10). It records the payment as received.
3. The switch credits Heron. POST https://pay.heron.example/switch/v1/credit, signed as switch:IN, with Idempotency-Key: 3f0b6c1e-8a4d-4c2b-9e71-5d2a8f6b0c94:
{ "payment": { "id": "3f0b6c1e-8a4d-4c2b-9e71-5d2a8f6b0c94", "from_address": "asha@kestrel", "from_name": "Asha Rao",
"to_address": "ravi@heron", "amount": { "value": "500.00", "currency": "INR" }, "fx": null, "note": "Dinner",
"collect_request_id": null, "created_at": "2026-11-28T10:00:00.412000+00:00" } }
Heron credits Ravi and answers {"status":"credited","id":"3f0b6c1e-8a4d-4c2b-9e71-5d2a8f6b0c94"}. The switch moves the payment to credited, then to completed, and writes two positions: bank:kestrel -50000 INR and bank:heron +50000 INR.
4. The switch answers Kestrel.
{ "id": "3f0b6c1e-8a4d-4c2b-9e71-5d2a8f6b0c94", "status": "completed", "state": "completed", "failure_reason": null,
"direction": "domestic", "from_address": "asha@kestrel", "to_address": "ravi@heron", "to_name": null,
"amount": { "value": "500.00", "currency": "INR" }, "receive": null, "fee": null, "rate": null, "note": "Dinner",
"collect_request_id": null, "created_at": "2026-11-28T10:00:00.412000Z", "completed_at": "2026-11-28T10:00:00.655000Z" }
Kestrel takes the money it set aside. If the switch had not answered within 10 seconds, Kestrel would keep the money aside, read the payment, and repeat step 2 with the same key and body (SW-10.6).
5. Settlement. An operator runs a cycle with this one payment open:
{ "id": "a41f2d9c-6b0e-4f6a-8d3c-1e2b7c9f0a55", "status": "settled", "created_at": "2026-11-28T18:00:00.000000Z",
"payments_settled": 1,
"banks": [
{ "participant": "bank:heron", "net": { "value": "500.00", "currency": "INR" }, "direction": "switch_pays_bank" },
{ "participant": "bank:kestrel", "net": { "value": "-500.00", "currency": "INR" }, "direction": "bank_pays_switch" }
],
"link": null, "fees": [], "balanced": true }
15. Security considerations
- Who may call what. Each endpoint family accepts one kind of participant from one country (SW-4.10). A bank’s connector accepts only its own switch. A bank cannot pay from, ask for money for, or quote for an address it does not speak for (SW-7.7, SW-7.16, SW-7.4).
- Replay. A signature stays valid for 120 seconds, and there is no
jti(SW-4.8). A replayed state-changing call within that window hits its idempotency key, as long as the original carried one (SW-5.1). Quote and status calls may be sent without a key. A replayed signed read returns the same record to the same party. - What the signature does not cover. It covers method, URL path and body. It does not cover the query string, the
Idempotency-Keyheader or any other header. Nothing on the rail uses a query string today. - Unsigned responses. A caller trusts an answer because it came over TLS from the registry’s
base_url(SW-4.16). A compromised TLS endpoint or registry could forge answers, includingcompleted. - Key compromise. A bank’s or switch’s signing key lets the holder act as that participant within the endpoint rules. Removing the key from the JWK Set ends it once caches expire (300 seconds in the reference). Suspending the participant in the registry ends it once the participant list cache expires (60 seconds).
- Unknown outcomes. Treating a timeout as failure could release money the payee was already credited with. SW-10.2 and SW-10.3 keep it pending until an answer is certain.
- The PIN in a provider’s payment. The PIN message (OCI-PAY-3) is encrypted to the bank and carries a nonce and an
iat. It is not bound to the payment’s amount or payee, so the bank relies on the switch for those. - Registry outage. Verifiers fail closed (SW-4.15). The switch’s stale list (SW-3.8) means a suspension made during an outage is not seen until the registry is back.
16. Privacy considerations
- The PIN. For a payment a bank starts, the PIN goes from the customer to the bank and never reaches the switch. For a payment a provider starts, the switch carries the PIN as a JWE encrypted to the bank’s PIN key (
ECDH-ESon P-256,A256GCM, as in CORE-5.8). The switch cannot read it, does not store it, and sends it on once (SW-9.8). Only the hash of the request body is kept with the idempotency key. - Lookups. A lookup returns the holder’s name and assurance level to any bank of the country, for any address. The switch does not rate-limit lookups. This allows enumeration of names by address (OCI-PAY-1).
- What the switch keeps. Each payment record keeps both addresses, the payer’s name, the note and the amounts. Each request for money keeps both addresses, the payee’s name and assurance level, and the note. OCI-PAY-2 sets no retention period.
- What each party sees. A bank sees only payments it is a party to (SW-7.14). The payee’s bank learns the payer’s address and name. Settlement output carries participant ids and nets only.
- Logs. Implementations follow CORE-7.3. The reference does not log PINs, tokens or bodies.
17. Conformance
A conforming switch serves §7 and the operator calls of §12, makes the calls of §8 as described, keeps the states of §9 and §11, sorts replies as in §10, writes positions as in §12, and answers errors as in §13. It signs and verifies as in §4 and applies §5.
A conforming bank connector serves §8, verifies as in §4, makes the calls of §7, is repeat-safe on payment and request ids (SW-5.8, SW-8.5, SW-8.7), and treats the switch’s answers as in SW-10.3 and SW-10.6.
The reference tests do not cite SW clauses yet. They cover:
| Clauses | Tests |
|---|---|
| SW-4.1 to 4.12, 4.14, 4.15 | ocipay-api/tests/test_switch.py (unsigned, badly signed, wrong participant, registry outage, suspended), test_units.py (signature round trip, tamper, malformed); ocipay-bank-api/tests/test_switch.py (bad and malformed signatures, attached payload, alg: none, registry down, inactive participant) |
| SW-5 | ocipay-api/tests/test_switch.py (repeat pays once, repeat of a pending payment moves it forward, settlement cycle repeat); ocipay-bank-api/tests/test_switch.py (in-flight duplicate, key scope) |
| SW-6 | ocipay-api/tests/test_units.py (money, rounding, addresses) |
| SW-7, SW-11 | ocipay-api/tests/test_switch.py (lookup, quotes, payments, input validation, collect requests and status roles, expiry) |
| SW-8 | ocipay-bank-api/tests/test_switch.py (lookup, credit once per id, debit, capture, release, request delivery and status) |
| SW-9, SW-10 | ocipay-api/tests/test_switch.py and test_providers.py (credit refused, bank timeout then retry, “already have it” answers stay pending, held debit released, capture resent); ocipay-bank-api/tests/test_wren.py (timeout, transport error and 5xx stay pending, 4xx releases) |
| SW-12 | ocipay-api/tests/test_switch.py (positions balance, cycles) |
No conformance harness runs these against a deployed switch or bank yet. SW-3, SW-4.13, SW-4.16 and SW-10.6 are deployment or behaviour rules that need one.
18. Open questions
Conflicts with OCI-0 and OCI-1.
- EdDSA and no
typ. CORE-5.1 and CORE-5.2 allow onlyES256andPS256, and CORE-5.4 requirestyp. The rail usesEdDSAwith notyp(SW-4.4, SW-4.5). Either CORE-5 gains a stated exception forOCI-Signature, or the rail moves toES256and adds atypsuch asoci-signature+jws. - Error format. CORE-9.1 says
{ "error", "error_description" }. The rail uses{ "error": { "code", "message" } }(SW-13.1). Pick one, or state the exception in CORE-9. - The registry is not OCI-1. OCI-1 is built on OpenID Federation entity statements and trust marks. The rail reads a flat participant list from
ocitrust(§3), with no signed statements, no trust marks forbank,switchorprovider, and no recognition caps applied. Decide whether to profile the participant list in OCI-1 or move the rail onto entity statements. - Country codes. CORE-3.2 says test and fictional countries use
XAtoXZ. The reference switch accepts onlyINandUSand uses real currency codes on mock money. - Key rotation. CORE-5.6 asks for a new key to be published 24 hours before use and an old key kept until its statements expire. The rail has no rotation procedure beyond SW-4.12 and SW-4.13, and the reference loads one key per participant.
Places the code is silent or looks accidental.
- Different codes on each side for the same signature failure. The switch answers
SIGNATURE_REQUIRED,403 FORBIDDENand503 TRUST_UNAVAILABLE. A bank’s connector answersSIGNATURE_MISSING,403 FORBIDDEN_PARTICIPANTand502 TRUST_REGISTRY_UNAVAILABLE. One set should be chosen. - A participant with no
status. The switch treats it as active, the connector as inactive. - Forced key refresh. The switch refetches on every failed verification with no limit. The connector refetches only on an unknown
kidand at most every 30 seconds. An attacker can make the switch fetch a JWK Set on every bad request. - Ambiguity rules differ. The switch treats
408,429and any409other than the two in SW-5.9 as refusals. The connector treats them as unknown (SW-10.3). The switch could fail a payment on a429from a bank that later credits it. - An error after a payment is recorded drops the key. If
POST /v1/paymentsrecords the payment and then fails (for example the registry is unreachable mid-run), the key is released (SW-5.7). A repeat without anidin the body makes a second payment. With anidit gets409 PAYMENT_ID_TAKEN, which the connector handles by reading the payment. Should anidbe required, or the key kept? - A refreshed repeat is not stored. SW-5.6 returns the current record but leaves the stored result as it was, so every later repeat runs the payment again.
- Debit state can stay
held. A bank’s connector captures or releases on its own when it reads a final status (SW-10.3). The switch does not learn of it and keepsdebit_statehelduntil something runs the payment again. - A debit answered
capturedfails the payment. If the bank’s answer to a debit iscapturedorreleased, the switch fails the payment withDEBIT_CLOSED, even forcaptured. - No switch timer. Nothing moves a stuck payment forward on a schedule (SW-10.5). A provider’s payment stuck after a bank timeout depends on the provider repeating it.
- The payee is not re-checked at routing.
_forwardlooks the payee participant up without checking it is stillactive, so a payment recorded before a suspension is still credited. payee_nameis optional at the switch but required by the connector. A request for money with nopayee_nameis refused by the payer’s bank as422 REQUEST_REJECTED.- The connector reports
approvedafter the switch has setpaid. After a payment for a request completes, the payer’s connector sends statusapproved. The switch has already setpaidand refuses with409 REQUEST_CLOSED. The connector logs it and moves on. - Ignored members. The connector sends
from_countryand, for a cross-border payment,feeinPOST /v1/payments. The switch ignores both.to_namein the payment record staysnullfor a bank’s address, because the connector’s credit answer carries no name. - Amount limits differ. The switch accepts up to 12 integer digits, the connector 10, capped at 10,000,000.00.
- Two switches only. The switch finds its peer as “the switch of another country”, and positions name one
link. More than two countries needs a rule. - Settlement is a record only. Cycles are run by hand. Nothing says when, or how the nets are paid.
- The link fee is a fixed figure per currency (INR 20.00, USD 1.62), not converted at the rate. OCI-PAY-4 should confirm.
- Lookup rate limits. The OCI-9 proposal (now OCI-PAY-1) required rate limits and no enumeration. The switch has neither.
Where the existing drafts disagree with the code. docs/api/oci-9-payments.yaml, oci-9-payments-switch.yaml, docs/api/schemas/payments-*.json, docs/api/GAPS.md and plan 003 were written before the build changed. Each point below follows the code.
- Countries and money. The drafts use Tavora (
XT,TVD) and Corvane (XC,CVK) and bankscommons,salt,northmere. The code usesIN/INRandUS/USD. - Money syntax.
payments-money.jsonrequires exactly two decimals and no leading zero. The code accepts 0 to 2 decimals and leading zeros on input (SW-6.3), and always sends two. - Ids. The drafts use ids such as
pay_8c2d41aa,qt_7f3k29xq,rq_4d19b2e7. The code uses UUIDs (SW-6.6). - Payment body. The draft wraps the bank’s payment as
{ "payment": { ... } }withstatus,credit_amountandupdated_at. The code takes a flat body (SW-7.3). The credit call does use{ "payment": ... }, but withamount(notcredit_amount) andfx. - Payment record.
payments-payment.jsonputs the internal state instatusand hascredit_amount,from_name,to_namerequired, andupdated_at. The code returnsstatusaspending,completed,failedorreversed, the state instate, plusdirection,receiveandcompleted_at, and noupdated_at(SW-7.13). - Quote. The draft answers
201withouttotal_debit. The code answers200withtotal_debit(SW-7.5). The draft and plan 003 §11 say the originating switch issuesquote_idand the peer holds the same id. In the code the peer holds no quote: the link quote returns a price only (OCI-PAY-4). - Status codes. The drafts use
201for created quotes and requests. The code answers200everywhere. - Validation errors. The drafts give
400 INVALID_REQUEST. The code answers422 VALIDATION_ERROR. - Error codes.
payments-error.jsonlistsSIGNATURE_STALE,PARTICIPANT_UNKNOWN,PIN_INCORRECT,AMOUNT_INVALID,RATE_LIMITED,UPSTREAM_UNAVAILABLE,REQUEST_NOT_PENDING. The code usesSIGNATURE_EXPIRED,UNKNOWN_PARTICIPANT,WRONG_PIN,INVALID_AMOUNT, no rate limiting, and specific*_UNAVAILABLEcodes (§13). - Signature header schema.
payments-signature-header.jsonfixeshtmtoPOSTand limitsisstobank:andswitch:. The code signsGET /v1/payments/{id}and acceptsprovider:senders. - Collect request at the switch. The draft says the switch replaces
payee_nameandpayee_assurancewith its own lookup. The code passes the payee’s values through as sent. The draft says same-country payers only. The code supports both directions over the link. The draft has the payer’s bank reportpaidwith apayment_id. In the code only the switch setspaid(SW-7.21) and banks sendapproved,declined,cancelledorexpired. The draft’s status enum lacksapprovedandcancelled. The draft andGAPS.mdsay the switch expires requests itself and tells both banks. It does not (SW-11.3). The draft answers status changes with the full request. The code answers{ id, status, relayed }. - Bank’s credit answer. The draft answers
{ payment_id, status }withfailedas a possible200. The connector answers{ status: "credited", id }and refuses with a4xx. The switch accepts both (SW-8.3). - Timeouts. The drafts say the bank releases the money after 10 seconds without an answer and reports
failedwithTIMEOUT, and a502means no decision. In the code a timeout or5xxkeeps the payment pending and the money aside (SW-10.3), and plan 003 §11 agrees. - PIN digits.
payments-pin-claims.jsonandGAPS.mdallow 4 to 8 digits. The connector accepts 4 to 6. - Settlement cycle.
payments-settlement-cycle.jsonhascountryandclosed_at. The code returnsstatusandcreated_at, anddirectionon each entry (SW-12.4). - Admin authentication. The drafts mark admin routes unauthenticated, and plan 003 §11 says
503 ADMIN_DISABLEDwhen no token is set. The code takes the admin token or an operator’s OCI-ID sign-in, and answers401otherwise (SW-12.6). - Endpoints missing from the drafts.
/switch/v1/debit, its capture and release,GET /v1/payments(operator list),GET /v1/settlement/cycles,POST /v1/payments/{id}/retryand the provider calls (OCI-PAY-3) are not in the drafts. - Trust registry. Plan 003 §5 lists kinds
bank,switch,idp. The registry now also hasproviderandacts_for.
Changes
| Version | Date | What changed |
|---|---|---|
| 0.1.0 | 2026-11-28 | First version, extracted from the reference implementation. Numbered OCI-PAY-2 in the payments family (first drafted as OCI-13). SW-6.2 names the switch as the party that answers UNKNOWN_CURRENCY. Message tables for each call. |