← Specifications

OCI-PAY-3 Payment Apps

Version 0.1.0 · 2026-11-28 · Draft Changes
StatusDraft.
Version0.1.0, 2026-11-28
Profile ofNone: an OCI protocol
Depends onOCI-0 Core, OCI-1 Trust Registry, OCI-2 ID Auth, OCI-PAY-1 Payment Addressing, OCI-PAY-2 Payments Switch
Used byOCI-PAY-4 Switch Link
Reference implementationwren-api (a payment app), ocipay-api (the switch’s provider endpoints), ocipay-bank-api (bank connect)

1. Purpose

OCI-PAY-3 says how a payment app works with OCI-Pay. A payment app (a provider) gives people payment addresses under its own handle (asha@wren), points each address at a bank account the person connected, and asks a payments switch to move money. Wren and Finch are payment apps run by their own companies. SBI Pay is a bank’s own app.

A provider never holds money, never sees a PIN, and never talks to a bank. It talks to one switch: its home switch. Money always moves from bank to bank.

OCI-PAY-3 covers what the provider sends and what it must answer:

  1. the provider’s entry in the trust registry, and what a bank’s own app changes (§3, §15);
  2. which switch it calls and which switch may call it (§4, §6);
  3. bank connect, balance, payments, requests for money and reading payments (§8 to §13);
  4. the endpoints a provider serves for its switch (§14);
  5. how people sign in, and how a bank uses that sign-in to find their accounts (§7).

OCI-PAY-3 does not define address syntax or handle ownership (OCI-PAY-1), the signature on each call, idempotency, the bank-facing API, the payment state machine or settlement (OCI-PAY-2), or the calls between two switches (OCI-PAY-4). It does not define the API between a provider’s own server and its own phone or web app.

2. Terms and roles

TermMeaning
ProviderA payment app registered in the trust registry with kind provider. It issues addresses under its handle and keeps the directory address → connected account.
Bank’s own appA provider that acts for one bank (acts_for). It issues no addresses; it works on the addresses the bank issued (§15).
Home switchThe one switch a provider is registered with: the switch whose country equals the provider’s country in the registry.
Account’s switchThe switch of the country the connected account’s bank is in. It keeps every payment, request and connect for that account.
Account referenceAn opaque string a bank gives one provider for one account at connect. The provider knows the account only by it.
Offer idA short-lived id a bank gives for one account in a connect list. The provider sends it back to pick that account.
PIN messageThe person’s PIN, encrypted on their device to the bank’s PIN key as a compact JWE.
RelayA call the home switch passes to the other country’s switch for the provider (§6).

Participant ids in examples follow the registry: provider:wren, bank:sbi, switch:IN.

3. The registry entry

  • PSP-3.1 A provider MUST be registered in the trust registry (OCI-1) with kind provider, an id, a display_name, a base_url, a jwks_url, a status and a country.
  • PSP-3.2 country is the provider’s home: the switch it is registered with. A provider with no country MUST NOT be registered. A switch MUST treat a provider entry with no country as having no home switch, and refuse it.
  • PSP-3.3 A provider that is not a bank’s own app MUST carry an address_suffix: its handle. The handle MUST belong to no other participant (OCI-PAY-1). A registry MUST NOT register a provider whose handle is already taken.
  • PSP-3.4 A bank’s own app MUST carry acts_for set to the bank’s participant id and MUST NOT carry an address_suffix. Its country MUST equal the bank’s country. §15 says what this changes.
  • PSP-3.5 jwks_url MUST serve the public keys the provider signs with. The reference serves them at <base_url>/.well-known/jwks.json.
  • PSP-3.6 base_url is where switches reach the provider. A provider checks the htu of every signature against its own base_url (PSP-14.3), so the two MUST be the same string.
  • PSP-3.7 Only a provider whose status is active may call a switch or be called by one.

4. The home switch

  • PSP-4.1 A provider MUST send every call to its home switch, and to no other switch.
  • PSP-4.2 A provider MUST find its home switch from the registry: its own entry’s country, then the participant of kind switch with that country. If either is missing it MUST NOT call any switch.
  • PSP-4.3 A switch MUST accept a provider at its /v1 endpoints only when the provider’s country equals the switch’s country. It MUST refuse every other provider with 403 FORBIDDEN.
  • PSP-4.4 Each call belongs to the account’s switch: the switch of the country of the bank that holds the account the call is about. For a call about an account in the home country, the provider calls the home switch directly. For an account in the other country, it MUST send the call as a relay (§6).
  • PSP-4.5 A switch that gets a call about an account at a bank of another country MUST refuse it with 422 WRONG_SWITCH. This applies to bank connect, balance, a payment’s payer bank, and the payee account of a request for money.
  • PSP-4.6 A switch MUST reach a provider only through the provider’s home switch. When the provider’s home is another country, the switch sends the call over the link (OCI-PAY-4). The provider therefore only ever hears from its home switch (PSP-14.2).

5. Calling the switch

  • PSP-5.1 Every call a provider makes MUST carry an OCI-Signature by the provider’s key, signed as OCI-PAY-2 §4 requires. The signature’s iss is the provider’s participant id.
  • PSP-5.2 A provider uses the same /v1 endpoints a bank uses (OCI-PAY-2), plus the provider-only endpoints of §8, §9 and §6. The switch tells a provider and a bank apart by the caller’s kind.
  • PSP-5.3 A provider MUST send an Idempotency-Key on POST /v1/payments and POST /v1/collect-requests, as OCI-PAY-2 §5 requires. A switch refuses either without one (400 IDEMPOTENCY_KEY_REQUIRED). The key is OPTIONAL on quotes and on status changes.
  • PSP-5.4 A provider SHOULD choose the id of each payment and each request for money itself (a UUID in id) and use that id as the Idempotency-Key. A repeat after a lost answer then reaches the same payment.
  • PSP-5.5 Bank connect and balance calls take no Idempotency-Key.
  • PSP-5.6 When the switch passes on a bank’s refusal, it MUST pass on the bank’s own status and error code (for example 403 WRONG_PIN, 403 PROVIDER_NOT_ALLOWED). When the bank does not answer, the switch MUST answer 503 BANK_UNAVAILABLE. For a bank id that is not an active registered bank it MUST answer 404 BANK_NOT_FOUND.
  • PSP-5.7 A provider MUST treat a 4xx answer other than 408, 409 and 429 as a definite refusal. It MUST treat a timeout, a transport error, a 5xx, 408, 409 or 429 as “not known yet”: the call may have taken effect.

6. Relay

The provider asks its home switch to pass a call to the other country’s switch. The other switch runs it as if the provider had called it there, and the answer comes back the same way. How the two switches do this is OCI-PAY-4.

  • PSP-6.1 A relay is POST /v1/relay at the home switch, signed by the provider, with the body:

    MemberTypeMeaning
    countrytwo lettersthe account’s country: the switch to pass the call to
    methodGET or POST, default POSTthe method of the call as the provider would make it there
    pathstring, 4 to 200 charactersthe path of the call there, for example /v1/payments
    bodyobject or nullthe body the call would carry; null for a GET
  • PSP-6.2 Only these calls may be relayed. A switch MUST refuse any other method and path with 404 NOT_RELAYED before anything leaves it:

    MethodPath
    POST/v1/connect/accounts, /v1/connect/link, /v1/connect/unlink
    POST/v1/balance
    POST/v1/lookup, /v1/quotes, /v1/payments
    POST/v1/collect-requests, /v1/collect-requests/{id}/status
    GET/v1/payments/{id}
  • PSP-6.3 A provider MUST NOT relay a call whose country is its home country. The switch refuses it with 422 NOT_RELAYED.

  • PSP-6.4 Only a provider whose home is this switch may relay. A switch MUST refuse any other caller, banks included, with 403.

  • PSP-6.5 When no switch is linked for country, the home switch MUST answer 404 NO_SWITCH. When the other switch does not answer, it MUST answer 503 PEER_UNAVAILABLE.

  • PSP-6.6 The home switch MUST return the other switch’s answer as that switch gave it: a success body unchanged, and an error with the other switch’s status and code.

  • PSP-6.7 The Idempotency-Key on POST /v1/relay travels with the call. A provider MUST put on the relay the key it would have put on the call itself (PSP-5.3).

  • PSP-6.8 A relayed GET is sent as POST /v1/relay with method GET and body null. The provider signs the relay POST, not the GET.

  • PSP-6.9 A relay changes nothing about where the work is kept. The payment, the request for money and the bank connect are kept by the account’s switch.

POST /v1/relay Pass a call to the other country's switch · served by the switch

The home switch passes the app's call to the switch of the account's country and returns that switch's answer unchanged. Called by a payment app registered with this switch. Defined in PSP-6.1, PSP-6.2, PSP-6.3, PSP-6.4, PSP-6.5, PSP-6.6, PSP-6.7, PSP-6.8.

RequestTypeRequiredMeaningClause
countrystringyesThe account's country, two letters: the switch to pass the call to. Never the home country. (pattern ^[A-Za-z]{2}$)PSP-6.3
method"GET" | "POST"The method of the call as the app would make it there.PSP-6.8
pathstringyesThe path of the call there, such as /v1/payments; only the paths PSP-6.2 lists. (at most 200 characters; at least 4)PSP-6.2
bodyobject, nullThe body the call would carry; null for a GET.PSP-6.8
ResponseTypeRequiredMeaningClause

Errors

7. Sign-in and identity

People sign in to a provider at an OCI-ID: in the reference, the provider’s own OCI-ID (OCI-2). A bank uses that same sign-in to find the person’s accounts.

  • PSP-7.1 A provider MUST authenticate each person by an OCI-ID access token from an issuer it accepts. In the reference it MUST check: the token is a JWS signed ES256, its header typ is at+jwt, iss is one of the provider’s accepted issuers, client_id is one of the provider’s own client ids and is in aud, sub is present and exp has not passed.
  • PSP-7.2 OCI-ID gives each client its own sub for the same person (AUTH-9.8). A provider that runs several apps (web, phone) SHOULD treat the same issuer and the same verified phone as one person, and record each (iss, sub) it has seen for that person.
  • PSP-7.3 For bank connect a provider MUST pass the signed-in person’s own current access token as identity_token (§8). It MUST NOT pass a token of another person, a token it kept after the person’s session ended, or an ID token.
  • PSP-7.4 A bank MUST verify identity_token before it lists anything: issuer, signature, typ at+jwt, exp, and client_id among the client ids it accepts. It MUST refuse an issuer it does not accept with 401.
  • PSP-7.5 A bank MUST find accounts only by the phone number the person’s identity vouches for. In the reference the bank asks the token’s issuer (<iss>/userinfo, with the token) for phone_number. With no phone it MUST answer 403 NO_VERIFIED_PHONE.
  • PSP-7.6 A bank accepts the sign-ins of its own OCI-ID, its country’s OCI-ID, and the OCI-ID of each registered payment app it chooses to trust. Which ones is the bank’s policy. Linking an account always needs that account’s PIN as well (PSP-8.9).
  • PSP-7.7 A provider MUST show a refusal from a bank that does not accept the person’s sign-in as such. The reference turns the bank’s 401 into 403 IDENTITY_NOT_ACCEPTED for its own app.

8. Bank connect

Bank connect is how an address comes to point at an account. It runs provider → home switch → (link →) account’s switch → bank. The switch adds the provider’s id to each call, so the bank knows which provider asks.

8.1 List the accounts

  • PSP-8.1 POST /v1/connect/accounts with { "bank": "<bank id>", "identity_token": "<access token>" }. identity_token is at most 8000 characters.

  • PSP-8.2 The switch MUST pass to the bank { "provider": "<caller id>", "identity_token": ... }, signed by the switch. It MUST NOT keep the token.

  • PSP-8.3 The bank answers:

    MemberMeaning
    bank, bank_name, countrywho answered
    accountsone entry per account the bank holds under the verified phone: id (an offer id), kind, masked (**** 1234), currency, holder_name, linked (whether this provider already has it)
    pin_keythe bank’s public PIN key, an EC P-256 JWK with alg ECDH-ES and use enc
  • PSP-8.4 The bank MUST NOT return a full account number. It MUST issue a new offer id per account per call, bind it to the calling provider, and let it expire. The reference keeps an offer for 10 minutes.

POST /v1/connect/accounts Find a person's accounts at a bank · served by the switch

The switch passes the person's sign-in to the bank, naming the app that asks, and returns the bank's answer. Called by a payment app, at its home switch or by relay. Defined in PSP-8.1, PSP-8.2, PSP-8.3, PSP-8.4, PSP-7.3, PSP-7.4, PSP-7.5.

RequestTypeRequiredMeaningClause
bankstringyesThe bank's id in the trust registry, such as bank:sbi. (at most 100 characters)PSP-8.1
identity_tokenstringyesThe signed-in person's own current OCI-ID access token, at most 8000 characters. (at most 8000 characters)PSP-7.3
ResponseTypeRequiredMeaningClause
bankstringyesThe bank's id in the trust registry, such as bank:sbi.
bank_namestringyesThe name of the bank that answered.
countrystringyesThe bank's country, an ISO 3166 two-letter code. (pattern ^[A-Z]{2}$)
accountsarray of objectyesOne entry per account the bank holds under the person's verified phone.PSP-8.3
accounts[].idstringyesAn offer id: new on every call, bound to the calling app, good for ten minutes.PSP-8.4
accounts[].kindstringyesThe kind of account, such as savings.
accounts[].maskedstringyesThe account number with all but the last four digits hidden, such as **** 1234.PSP-8.4
accounts[].currencystringyesThe account's currency, an ISO 4217 code. (pattern ^[A-Z]{3}$)
accounts[].holder_namestringyesThe account holder's name.
accounts[].linkedbooleanyesWhether this app already has this account connected.
pin_keyobjectyesThe bank's public PIN key, an EC P-256 JWK. The person's device encrypts PIN messages to it.PSP-8.3
pin_key.kty"EC"yesKey type.
pin_key.crv"P-256"yesCurve.
pin_key.xstringyesThe key's x coordinate, base64url.
pin_key.ystringyesThe key's y coordinate, base64url.
pin_key.kidstringyesThe key's id; a PIN message names it.
pin_key.alg"ECDH-ES"yesKey agreement algorithm.
pin_key.use"enc"yesWhat the key is for.

Errors

POST /switch/v1/connect/accounts Which accounts does this person hold? · served by a bank

The bank checks the token, asks its issuer for the person's verified phone, and lists the accounts under it as offer ids, never account numbers. Called by the switch of the bank's own country. Defined in PSP-8.1, PSP-8.2, PSP-8.3, PSP-8.4, PSP-7.3, PSP-7.4, PSP-7.5.

RequestTypeRequiredMeaningClause
providerstringyesThe payment app's id in the trust registry, such as provider:wren. Filled in by the switch. (at most 100 characters)PSP-8.2
identity_tokenstringyesThe signed-in person's own current OCI-ID access token, at most 8000 characters. (at most 8000 characters)PSP-7.3
ResponseTypeRequiredMeaningClause
bankstringyesThe bank's id in the trust registry, such as bank:sbi.
bank_namestringyesThe name of the bank that answered.
countrystringyesThe bank's country, an ISO 3166 two-letter code. (pattern ^[A-Z]{2}$)
accountsarray of objectyesOne entry per account the bank holds under the person's verified phone.PSP-8.3
accounts[].idstringyesAn offer id: new on every call, bound to the calling app, good for ten minutes.PSP-8.4
accounts[].kindstringyesThe kind of account, such as savings.
accounts[].maskedstringyesThe account number with all but the last four digits hidden, such as **** 1234.PSP-8.4
accounts[].currencystringyesThe account's currency, an ISO 4217 code. (pattern ^[A-Z]{3}$)
accounts[].holder_namestringyesThe account holder's name.
accounts[].linkedbooleanyesWhether this app already has this account connected.
pin_keyobjectyesThe bank's public PIN key, an EC P-256 JWK. The person's device encrypts PIN messages to it.PSP-8.3
pin_key.kty"EC"yesKey type.
pin_key.crv"P-256"yesCurve.
pin_key.xstringyesThe key's x coordinate, base64url.
pin_key.ystringyesThe key's y coordinate, base64url.
pin_key.kidstringyesThe key's id; a PIN message names it.
pin_key.alg"ECDH-ES"yesKey agreement algorithm.
pin_key.use"enc"yesWhat the key is for.

Errors

  • PSP-8.5 POST /v1/connect/link with { "bank": "<bank id>", "account_id": "<offer id>", "pin": "<PIN message>" }. pin is at most 4000 characters.

  • PSP-8.6 The PIN message MUST be made on the person’s device, encrypted to the bank’s pin_key: a compact JWE with alg ECDH-ES, enc A256GCM and the key’s kid, over the JSON { "pin": "<4 to 6 digits>", "nonce": "<1 to 128 characters, new each time>", "iat": <NumericDate> }.

  • PSP-8.7 The provider MUST pass the PIN message unchanged. The switch MUST pass it unchanged. Neither can decrypt it.

  • PSP-8.8 The bank MUST refuse an offer id that is unknown, expired, or was given to another provider, with 404 ACCOUNT_OFFER_NOT_FOUND.

  • PSP-8.9 The bank MUST decrypt the PIN message and check it before it links. It MUST refuse a message it cannot read (400 PIN_INVALID), one whose iat is more than 300 seconds from now (400 PIN_EXPIRED), and one whose nonce it has seen (400 PIN_REPLAYED). A wrong PIN is 403 WRONG_PIN. Too many wrong PINs is 423 PIN_LOCKED.

  • PSP-8.10 On success the bank MUST record that this provider may use this account (the consent, §8.4), MUST end the offer, and answers:

    MemberMeaning
    bank, bank_name, countrywho answered
    accountthe account reference for this provider
    assurancehow well the bank knows the account holder (CORE-4)
    pin_keythe bank’s PIN key, for later PIN messages
    addressthe address the bank itself issued for the account (asha@sbi)
    kind, masked, currency, holder_namethe account as shown to the person
POST /v1/connect/link Connect an account to the app · served by the switch

The bank checks the PIN message and returns an account reference only this app can use. Called by a payment app, at its home switch or by relay. Defined in PSP-8.5, PSP-8.6, PSP-8.7, PSP-8.8, PSP-8.9, PSP-8.10, PSP-8.13.

RequestTypeRequiredMeaningClause
bankstringyesThe bank's id in the trust registry, such as bank:sbi. (at most 100 characters)PSP-8.5
account_idstringyesOne of the offer ids the bank answered with when asked for the person's accounts.PSP-8.5
pinstringyesA PIN message: the person's PIN encrypted on their device to the bank's pin_key, as a compact JWE. Passed on unchanged. (at most 4000 characters)PSP-8.6
ResponseTypeRequiredMeaningClause
bankstringyesThe bank's id in the trust registry, such as bank:sbi.
bank_namestringyesThe name of the bank that answered.
countrystringyesThe bank's country, an ISO 3166 two-letter code. (pattern ^[A-Z]{2}$)
accountstringyesThe account reference for this app. The app stores it and names the account by it alone.PSP-8.11
assurance"low" | "substantial" | "high"yesHow well the bank knows the account holder (CORE-4).PSP-8.10
pin_keyobjectyesThe bank's PIN key. The app keeps it with the link for later PIN messages.PSP-8.14
pin_key.kty"EC"yesKey type.
pin_key.crv"P-256"yesCurve.
pin_key.xstringyesThe key's x coordinate, base64url.
pin_key.ystringyesThe key's y coordinate, base64url.
pin_key.kidstringyesThe key's id; a PIN message names it.
pin_key.alg"ECDH-ES"yesKey agreement algorithm.
pin_key.use"enc"yesWhat the key is for.
addressstring, nullyesThe address the bank itself issued for the account, such as asha@sbi. A bank's own app uses it.PSP-15.1
kindstringyesThe kind of account, such as savings.
maskedstringyesThe account number with all but the last four digits hidden, such as **** 1234.PSP-8.4
currencystringyesThe account's currency, an ISO 4217 code. (pattern ^[A-Z]{3}$)
holder_namestringyesThe account holder's name.

Errors

POST /switch/v1/connect/link Allow a payment app on an account · served by a bank

The bank checks the PIN, records that the person allowed this app, ends the offer and returns the reference the app uses from then on. Called by the switch of the bank's own country. Defined in PSP-8.5, PSP-8.6, PSP-8.7, PSP-8.8, PSP-8.9, PSP-8.10, PSP-8.13.

RequestTypeRequiredMeaningClause
providerstringyesThe payment app's id in the trust registry, such as provider:wren. Filled in by the switch. (at most 100 characters)PSP-8.2
account_idstringyesOne of the offer ids the bank answered with when asked for the person's accounts.PSP-8.5
pinstringyesA PIN message: the person's PIN encrypted on their device to the bank's pin_key, as a compact JWE. Passed on unchanged. (at most 4000 characters)PSP-8.6
ResponseTypeRequiredMeaningClause
bankstringyesThe bank's id in the trust registry, such as bank:sbi.
bank_namestringyesThe name of the bank that answered.
countrystringyesThe bank's country, an ISO 3166 two-letter code. (pattern ^[A-Z]{2}$)
accountstringyesThe account reference for this app. The app stores it and names the account by it alone.PSP-8.11
assurance"low" | "substantial" | "high"yesHow well the bank knows the account holder (CORE-4).PSP-8.10
pin_keyobjectyesThe bank's PIN key. The app keeps it with the link for later PIN messages.PSP-8.14
pin_key.kty"EC"yesKey type.
pin_key.crv"P-256"yesCurve.
pin_key.xstringyesThe key's x coordinate, base64url.
pin_key.ystringyesThe key's y coordinate, base64url.
pin_key.kidstringyesThe key's id; a PIN message names it.
pin_key.alg"ECDH-ES"yesKey agreement algorithm.
pin_key.use"enc"yesWhat the key is for.
addressstring, nullyesThe address the bank itself issued for the account, such as asha@sbi. A bank's own app uses it.PSP-15.1
kindstringyesThe kind of account, such as savings.
maskedstringyesThe account number with all but the last four digits hidden, such as **** 1234.PSP-8.4
currencystringyesThe account's currency, an ISO 4217 code. (pattern ^[A-Z]{3}$)
holder_namestringyesThe account holder's name.

Errors

8.3 The account reference

  • PSP-8.11 The account reference is opaque. A provider MUST store it, MUST NOT try to read anything from it, and MUST use it as the only way it names the account to the switch.
  • PSP-8.12 A bank MUST give a reference that works only for the provider it was given to. Every later use (balance, debit) MUST name that provider, and the bank MUST refuse a reference used by any other provider, or after it ended, with 403 PROVIDER_NOT_ALLOWED.
  • PSP-8.13 While a link is active, linking the same account again for the same provider MUST return the same reference. After unlink, a new link gets a new reference.
  • PSP-8.14 A provider MUST keep the pin_key with the link, so the person’s device can encrypt later PIN messages to it.
  • PSP-8.15 The consent is recorded at the bank: provider, account, reference, status, and when it ended. The bank is the authority on it. The provider’s copy is a cache.
  • PSP-8.16 POST /v1/connect/unlink with { "bank": "<bank id>", "account": "<reference>" } ends the link. The bank answers { "account": "<reference>", "status": "ended", "changed": <bool> }. Unlinking an ended or unknown reference MUST succeed with changed false.
  • PSP-8.17 When a person disconnects an account, the provider MUST unlink it at the bank first, and only then remove the addresses that pointed at it.
  • PSP-8.18 A provider MUST treat 403 PROVIDER_NOT_ALLOWED on any later call as “the bank has ended this link”, and ask the person to connect again.
POST /v1/connect/unlink Disconnect an account · served by the switch

Ends the app's permission on the account at the bank; unlinking an ended or unknown reference still succeeds. Called by a payment app, at its home switch or by relay. Defined in PSP-8.15, PSP-8.16, PSP-8.17.

RequestTypeRequiredMeaningClause
bankstringyesThe bank's id in the trust registry, such as bank:sbi. (at most 100 characters)PSP-8.15
accountstringyesThe account reference the bank gave this payment app at link. Opaque; only that app can use it.PSP-8.11
ResponseTypeRequiredMeaningClause
accountstringyesThe account reference that was unlinked.
status"ended"yesAlways ended.PSP-8.16
changedbooleanyesFalse when the reference had already ended or was unknown.PSP-8.16

Errors

POST /switch/v1/connect/unlink End a payment app's permission · served by a bank

The bank ends the consent and the reference stops working. Called by the switch of the bank's own country. Defined in PSP-8.15, PSP-8.16, PSP-8.17.

RequestTypeRequiredMeaningClause
providerstringyesThe payment app's id in the trust registry, such as provider:wren. Filled in by the switch. (at most 100 characters)PSP-8.2
accountstringyesThe account reference the bank gave this payment app at link. Opaque; only that app can use it.PSP-8.11
ResponseTypeRequiredMeaningClause
accountstringyesThe account reference that was unlinked.
status"ended"yesAlways ended.PSP-8.16
changedbooleanyesFalse when the reference had already ended or was unknown.PSP-8.16

9. Balance

  • PSP-9.1 POST /v1/balance with { "bank": "<bank id>", "account": "<reference>" }. The bank answers { "balance": <money>, "available": <money>, "kind", "masked", "currency", "holder_name" }. Money is as OCI-PAY-2 §6 writes it.
  • PSP-9.2 The bank MUST answer only for an active reference given to the calling provider (PSP-8.12).
  • PSP-9.3 A balance read takes no PIN in this version. The link the person made with the PIN covers it.
  • PSP-9.4 A provider MUST NOT store a balance as its own record. It shows what the bank said just now.
POST /v1/balance Read a balance · served by the switch

The balance of a connected account, straight from the bank; the app shows it and does not keep it. Called by a payment app, at its home switch or by relay. Defined in PSP-9.1, PSP-9.2, PSP-9.3, PSP-9.4.

RequestTypeRequiredMeaningClause
bankstringyesThe bank's id in the trust registry, such as bank:sbi. (at most 100 characters)PSP-9.1
accountstringyesThe account reference the bank gave this payment app at link. Opaque; only that app can use it.PSP-8.11
ResponseTypeRequiredMeaningClause
balanceobjectyesEverything in the account.PSP-9.1
balance.valuestringyesA decimal string, such as "250.00". Never a float. (pattern ^-?\d+(\.\d{1,2})?$)
balance.currencystringyesISO 4217 code, such as INR or USD. (pattern ^[A-Z]{3}$)
availableobjectyesWhat is free to spend: the balance less any holds.PSP-9.1
available.valuestringyesA decimal string, such as "250.00". Never a float. (pattern ^-?\d+(\.\d{1,2})?$)
available.currencystringyesISO 4217 code, such as INR or USD. (pattern ^[A-Z]{3}$)
kindstringyesThe kind of account, such as savings.
maskedstringyesThe account number with all but the last four digits hidden, such as **** 1234.PSP-8.4
currencystringyesThe account's currency, an ISO 4217 code. (pattern ^[A-Z]{3}$)
holder_namestringyesThe account holder's name.

Errors

POST /switch/v1/balance Balance of a connected account · served by a bank

Answered only for a reference that is still active for the calling app. Called by the switch of the bank's own country. Defined in PSP-9.1, PSP-9.2, PSP-9.3, PSP-9.4.

RequestTypeRequiredMeaningClause
providerstringyesThe payment app's id in the trust registry, such as provider:wren. Filled in by the switch. (at most 100 characters)PSP-8.2
accountstringyesThe account reference the bank gave this payment app at link. Opaque; only that app can use it.PSP-8.11
ResponseTypeRequiredMeaningClause
balanceobjectyesEverything in the account.PSP-9.1
balance.valuestringyesA decimal string, such as "250.00". Never a float. (pattern ^-?\d+(\.\d{1,2})?$)
balance.currencystringyesISO 4217 code, such as INR or USD. (pattern ^[A-Z]{3}$)
availableobjectyesWhat is free to spend: the balance less any holds.PSP-9.1
available.valuestringyesA decimal string, such as "250.00". Never a float. (pattern ^-?\d+(\.\d{1,2})?$)
available.currencystringyesISO 4217 code, such as INR or USD. (pattern ^[A-Z]{3}$)
kindstringyesThe kind of account, such as savings.
maskedstringyesThe account number with all but the last four digits hidden, such as **** 1234.PSP-8.4
currencystringyesThe account's currency, an ISO 4217 code. (pattern ^[A-Z]{3}$)
holder_namestringyesThe account holder's name.

Errors

10. Addresses the provider issues

  • PSP-10.1 A provider issues addresses only under its own handle (OCI-PAY-1). Each address MUST point at exactly one active connected account of the person who holds it.
  • PSP-10.2 A provider MAY let a person point an address at another of their connected accounts. People who pay that address change nothing.
  • PSP-10.3 One account MAY have addresses at several providers. Each provider sees only payments made through its own addresses.
  • PSP-10.4 When the account behind an address is unlinked, the provider MUST stop resolving that address (PSP-14.6).
  • PSP-10.5 An address MAY point at an account in either country. Its handle has no country; the account does.

11. Payments a provider starts

  • PSP-11.1 POST /v1/payments at the payer account’s switch, with an Idempotency-Key (PSP-5.3). A provider’s payment carries, beyond the OCI-PAY-2 payment fields (id, from_address, from_name, to_address, amount, note, quote_id, collect_request_id):

    MemberMeaning
    payer{ "bank": "<bank id>", "account": "<reference>" }: the account the money leaves, as its bank knows it
    credentiala new PIN message (PSP-8.6) for that account, at most 4000 characters
  • PSP-11.2 A switch MUST refuse a provider’s payment without payer or credential (422 PAYER_REQUIRED), and a bank’s payment that carries either (422 PAYER_NOT_ALLOWED).

  • PSP-11.3 payer.bank MUST be an active registered bank (422 PAYER_BANK_UNKNOWN) of the switch’s own country (422 WRONG_SWITCH).

  • PSP-11.4 from_address MUST be under the provider’s own handle, or, for a bank’s own app, under its bank’s handle and paid from that bank’s account (§15). A switch MUST refuse any other with 403 ADDRESS_NOT_OWNED.

  • PSP-11.5 A provider MUST use as from_address an address it issued for the paying account. For a bank’s own app it is the address the bank issued.

  • PSP-11.6 amount MUST be in the currency of the payer account’s switch (422 CURRENCY_MISMATCH). A provider MUST NOT pay its own from_address (422 SELF_PAYMENT).

  • PSP-11.7 Before a payment the provider SHOULD look the payee up (POST /v1/lookup, OCI-PAY-2) at the payer account’s switch. The answer’s cross_border says whether a quote is needed.

  • PSP-11.8 A payment to an account in another country MUST carry the quote_id of an unexpired, unused quote the same provider obtained from the same switch (POST /v1/quotes with from_address, to_address, amount). amount MUST equal the quote’s send. A same-country payment MUST NOT carry a quote_id (422 QUOTE_NOT_ALLOWED). The quote rules are OCI-PAY-2’s.

  • PSP-11.9 The switch MUST pass the credential to the payer’s bank only, with the reference and the provider’s id, and MUST NOT keep it. The bank holds the money before anybody is credited (OCI-PAY-2). A later retry carries no PIN, so a hold the bank never received cannot be made again: the payment fails with DEBIT_NOT_FOUND, and the person pays again with a new PIN message.

  • PSP-11.10 The switch answers with the payment (OCI-PAY-2): id, status (completed, pending, failed), failure_reason, to_name and the rest. A failure on the PIN (WRONG_PIN, PIN_LOCKED, PIN_REPLAYED, PIN_INVALID, PIN_EXPIRED) means nothing moved.

  • PSP-11.11 A provider SHOULD keep a payment it started under the switch’s payment id. After a PIN failure it SHOULD keep no payment, and ask for the PIN again with a new payment id.

  • PSP-11.12 A payment whose answer is “not known yet” (PSP-5.7) MUST be kept as pending. The provider MUST find its outcome by reading it (§12) or by repeating the call with the same Idempotency-Key and body. It MUST NOT start a new payment for the same intent.

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.

RequestTypeRequiredMeaningClause
idstring, uuidThe payment id the bank chose; the switch chooses one when absent.SW-6.6
from_addressstringyesThe payer's address; it must be one the caller speaks for. (at most 200 characters)SW-7.7
from_namestringThe payer's name, as the bank holds it.
to_addressstringyesThe payee's address; it must differ from from_address. (at most 200 characters)SW-7.7
amountobjectyesThe principal, in the switch's currency, without the fee.SW-7.7
amount.valuestringyesA 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"yesThe ISO 4217 code: INR or USD.SW-6.2
notestringFree text from the payer, at most 140 characters. (at most 140 characters)SW-6.9
quote_idstring, uuidThe quote this payment uses: required for a cross-border payment, refused for a domestic one.SW-7.9
collect_request_idstring, uuidThe request for money this payment pays.SW-7.10
payerobjectFor 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.bankstringyesThe registry id of the bank that holds the account, such as bank:sbi.
payer.accountstringyesThe account reference that bank gave the provider.
credentialstringFor 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
ResponseTypeRequiredMeaningClause
idstring, uuidyesThe payment id.SW-6.6
status"pending" | "completed" | "failed" | "reversed"yesWhat a bank acts on: pending while the state is received or credited.SW-7.13
state"received" | "credited" | "completed" | "failed" | "reversed"yesThe switch's own state of the payment.SW-9.1
failure_reasonstring, nullyesWhy the payment failed: the refusal's code, or one the switch sets.SW-9.3
direction"domestic" | "outbound" | "inbound"yesWhether the payment stays in the country, leaves it, or came from the other country.SW-7.13
from_addressstringyesThe payer's address. (at most 200 characters)SW-6.8
to_addressstringyesThe payee's address. (at most 200 characters)SW-6.8
to_namestring, nullyesThe payee's name, when the payee's side gave one.
amountobjectyesThe principal, in the switch's currency, without the fee.SW-7.7
amount.valuestringyesA 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"yesThe ISO 4217 code: INR or USD.SW-6.2
receiveobject, nullyesWhat the payee receives, in the other country's currency; set for cross-border payments only.SW-7.13
feeobject, nullyesThe link fee in the switch's currency; set for cross-border payments only.SW-7.13
ratestring, nullyesThe exchange rate with two decimals; set for cross-border payments only.SW-7.13
notestring, nullyesFree text from the payer, at most 140 characters. (at most 140 characters)SW-6.9
collect_request_idstring, null, uuidyesThe request for money this payment pays, if any.SW-7.10
created_atstring, date-timeyesWhen the switch recorded the payment.SW-6.7
completed_atstring, null, date-timeyesWhen the payment completed, once it has.SW-6.7

Errors

12. Reading payments

  • PSP-12.1 GET /v1/payments/{id} at the payer account’s switch, signed by the provider, returns the payment as in PSP-11.10. For an account in the other country it is relayed (PSP-6.8).
  • PSP-12.2 A switch MUST return a payment to a provider only when that provider started it. It MUST answer every other id with 404 PAYMENT_NOT_FOUND, the same as an id that does not exist.
  • PSP-12.3 A provider SHOULD read a payment it holds as pending before showing it, and record the outcome.
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.

ResponseTypeRequiredMeaningClause
idstring, uuidyesThe payment id.SW-6.6
status"pending" | "completed" | "failed" | "reversed"yesWhat a bank acts on: pending while the state is received or credited.SW-7.13
state"received" | "credited" | "completed" | "failed" | "reversed"yesThe switch's own state of the payment.SW-9.1
failure_reasonstring, nullyesWhy the payment failed: the refusal's code, or one the switch sets.SW-9.3
direction"domestic" | "outbound" | "inbound"yesWhether the payment stays in the country, leaves it, or came from the other country.SW-7.13
from_addressstringyesThe payer's address. (at most 200 characters)SW-6.8
to_addressstringyesThe payee's address. (at most 200 characters)SW-6.8
to_namestring, nullyesThe payee's name, when the payee's side gave one.
amountobjectyesThe principal, in the switch's currency, without the fee.SW-7.7
amount.valuestringyesA 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"yesThe ISO 4217 code: INR or USD.SW-6.2
receiveobject, nullyesWhat the payee receives, in the other country's currency; set for cross-border payments only.SW-7.13
feeobject, nullyesThe link fee in the switch's currency; set for cross-border payments only.SW-7.13
ratestring, nullyesThe exchange rate with two decimals; set for cross-border payments only.SW-7.13
notestring, nullyesFree text from the payer, at most 140 characters. (at most 140 characters)SW-6.9
collect_request_idstring, null, uuidyesThe request for money this payment pays, if any.SW-7.10
created_atstring, date-timeyesWhen the switch recorded the payment.SW-6.7
completed_atstring, null, date-timeyesWhen the payment completed, once it has.SW-6.7

Errors

13. Requests for money

13.1 Asking someone for money

  • PSP-13.1 POST /v1/collect-requests at the payee account’s switch, with an Idempotency-Key (PSP-5.3), and the OCI-PAY-2 body: id, payee_address, payee_name, payee_assurance, payer_address, amount, note, expires_at.
  • PSP-13.2 payee_address MUST be an address the provider may speak for (PSP-11.4), pointing at an account in the switch’s country (422 WRONG_SWITCH). amount MUST be in the payee’s currency.
  • PSP-13.3 payee_assurance SHOULD be the assurance the bank gave at link (PSP-8.10).
  • PSP-13.4 The request goes to whoever stands behind payer_address: its provider, else its bank. If they refuse it, or nobody answers, the switch keeps no request and answers an error (OCI-PAY-2).
  • PSP-13.5 The provider hears how its request ended at /switch/v1/collect-requests/{id}/status (PSP-14.10).
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.

RequestTypeRequiredMeaningClause
idstring, uuidThe request id the bank chose; the switch chooses one when absent.SW-7.17
payee_addressstringyesThe address asking for money; it must be one the caller speaks for. (at most 200 characters)SW-7.16
payee_namestringThe 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_addressstringyesThe address asked to pay; it must differ from payee_address. (at most 200 characters)SW-7.16
amountobjectyesThe amount asked for, in the switch's currency.SW-7.16
amount.valuestringyesA 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"yesThe ISO 4217 code: INR or USD.SW-6.2
notestringFree text from the payee, at most 140 characters. (at most 140 characters)SW-6.9
expires_atstring, date-timeWhen the request stops being payable: in the future, at most 30 days ahead, 24 hours by default.SW-7.17
ResponseTypeRequiredMeaningClause
idstring, uuidyesThe request id.SW-6.6
status"pending"yesAlways pending: the request was delivered and not yet answered.SW-7.20
payee_addressstringyesThe address asking for money. (at most 200 characters)SW-6.8
payer_addressstringyesThe address asked to pay. (at most 200 characters)SW-6.8
amountobjectyesThe amount asked for, in the switch's currency.SW-6.1
amount.valuestringyesA 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"yesThe ISO 4217 code: INR or USD.SW-6.2
expires_atstring, date-timeyesWhen the request stops being payable.SW-7.17

Errors

13.2 A request to one of the provider’s addresses

  • PSP-13.6 The provider receives the request at /switch/v1/collect-requests (PSP-14.8) and shows it to the person.
  • PSP-13.7 To approve, the provider pays it: a payment (§11) from the request’s payer_address to its payee_address, for the request’s amount, carrying collect_request_id. When the payee is in another country, the provider gets a quote first.
  • PSP-13.8 To decline, the provider sends POST /v1/collect-requests/{id}/status with { "status": "declined", "report": <bool> } at the switch of the payer account’s country. report marks the request as unwanted.
  • PSP-13.9 A switch MUST let only a party to the request change its status (OCI-PAY-2). It answers any other caller with 404 REQUEST_NOT_FOUND.
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.

RequestTypeRequiredMeaningClause
status"approved" | "declined" | "cancelled" | "expired"yesThe new status; only the switch sets paid.SW-7.21
reportbooleanWith declined only: the payer reports the request as unwanted.SW-7.21
ResponseTypeRequiredMeaningClause
idstring, uuidyesThe request id.SW-6.6
status"approved" | "declined" | "cancelled" | "expired"yesThe status the request now has.
relayedbooleanyesWhether the other party accepted the new status; false when nothing changed.SW-7.25

Errors

14. Endpoints a provider serves

A provider MUST serve these, under <base_url>/switch/v1. Every call to them carries its home switch’s OCI-Signature.

Method and pathThe switch says
POST /switch/v1/resolvewho is behind this address
POST /switch/v1/collect-requestssomeone asks one of your people for money
POST /switch/v1/collect-requests/{id}/statushow a request ended
POST /switch/v1/payments/receivedmoney arrived at one of your addresses

14.1 Checking who calls

  • PSP-14.1 A provider MUST refuse an unsigned call (401 SIGNATURE_MISSING) and one whose signature does not verify against the caller’s keys from its registry jwks_url (401 SIGNATURE_INVALID).
  • PSP-14.2 A provider MUST accept a call only from its home switch: a participant that is active, of kind switch, whose country equals the provider’s own country. A caller that is not a switch, and any other switch, MUST get 403 FORBIDDEN_PARTICIPANT. An unknown or inactive caller MUST get 401 UNKNOWN_PARTICIPANT.
  • PSP-14.3 A provider MUST check that the signature’s htm equals the request method, and its htu equals the provider’s own base_url plus the request path.
  • PSP-14.4 A provider MUST refuse a signature whose iat is more than 120 seconds from now (401 SIGNATURE_EXPIRED). It MUST check the rest of the signature as OCI-PAY-2 §4 requires.
  • PSP-14.5 Switches send no Idempotency-Key to a provider. A provider MUST make each of these calls safe to repeat by the id it carries: a repeat changes nothing and gets the same kind of answer.

14.2 Resolve

  • PSP-14.6 Body { "address": "<address>" } (3 to 200 characters). The provider compares addresses in lower case. For an address it issued that points at an active link, it answers:

    { "address": "ravi@wren", "name": "Ravi Menon", "assurance": "substantial", "bank": "bank:hdfc", "account": "<reference>" }

    For any other address it MUST answer 404 ADDRESS_NOT_FOUND.

  • PSP-14.7 bank and account are REQUIRED in a success. A switch MUST treat an answer without them, or any refusal, as 404 ADDRESS_NOT_FOUND, and no answer as 503 PROVIDER_UNAVAILABLE. Every switch that routes a payment to the address asks for itself, and nothing is cached. A switch may ask while the provider’s own call to it is still open, so the provider MUST be able to answer resolve at any time.

POST /switch/v1/resolve Whose address is this? · served by a provider

For an address this app issued that points at an active link: the holder's name, the bank behind it, and the reference that bank gave the app. Called by Its home switch. Defined in PSP-14.6, PSP-14.7.

RequestTypeRequiredMeaningClause
addressstringyesA payment address this app issued, such as ravi@wren. Compared in lower case. (at most 200 characters; at least 3)PSP-14.6
ResponseTypeRequiredMeaningClause
addressstringyesThe address, in lower case.
namestringyesThe account holder's name, for payer confirmation.
assurance"low" | "substantial" | "high"yesHow well the bank knows the holder, as the bank gave it at link.
bankstringyesThe bank that holds the account behind the address.PSP-14.7
accountstringyesThe account reference that bank gave this app.PSP-14.7

Errors

14.3 A request for money

  • PSP-14.8 Body { "request": { "id", "payee_address", "payee_name", "payee_assurance", "payee_country", "payer_address", "amount", "note", "expires_at", "created_at" } }. The provider MUST find the person behind payer_address and record the request for them, once per id, and answers { "id": "<id>", "status": "pending" }. If nobody is behind payer_address it MUST answer 404 ADDRESS_NOT_FOUND; the switch then drops the request.
  • PSP-14.9 A provider MUST ignore members it does not know.
POST /switch/v1/collect-requests Deliver a request to the payer · served by a provider

A request for money addressed to one of this app's addresses; the app records it once per id and shows it to the person. Called by Its home switch. Defined in PSP-14.8, PSP-14.9, PSP-13.6, PSP-15.5.

RequestTypeRequiredMeaningClause
requestobjectyesThe request, as the switch keeps it.PSP-14.8
request.idstring, uuidyesThe id of the request or payment (a UUID). The same id is used by every party; a repeat with it changes nothing.PSP-14.5
request.payee_addressstringyesThe address asking for the money.
request.payee_namestring, nullyesThe name of whoever is asking.
request.payee_assurance"low" | "substantial" | "high" | "null"yesHow well the payee's bank knows the payee.
request.payee_countrystringyesThe country of the payee's account, an ISO 3166 two-letter code. (pattern ^[A-Z]{2}$)
request.payer_addressstringyesThe address being asked to pay: one this app issued (or its bank's, for a bank's own app).PSP-14.8
request.amountobjectyesThe amount asked for, in the payee's currency.PSP-13.2
request.amount.valuestringyesA decimal string, such as "250.00". Never a float. (pattern ^-?\d+(\.\d{1,2})?$)
request.amount.currencystringyesISO 4217 code, such as INR or USD. (pattern ^[A-Z]{3}$)
request.notestring, nullyesFree text from the payee, at most 140 characters. (at most 140 characters)
request.expires_atstring, date-timeyesWhen the request stops being payable.
request.created_atstring, date-timeyesWhen the switch recorded the request.
ResponseTypeRequiredMeaningClause
idstringyesThe request's id.
status"pending"yesAlways pending.PSP-14.8

Errors

14.4 How a request ended

  • PSP-14.10 Body { "status": "approved" | "declined" | "expired" | "cancelled" | "paid", "report": <bool, optional>, "side": "payer" (optional) }. The provider answers { "id": "<id>", "status": "<status>" }.
  • PSP-14.11 Without side: approved, declined and paid are about a request the provider sent (it is the payee); cancelled is about a request it received (it is the payer); expired may be about either. With side payer the status is about a request it received that was answered elsewhere (§15). A provider MUST NOT change a request already paid, declined or cancelled.
POST /switch/v1/collect-requests/{request_id}/status How a request ended · served by a provider

Tells the app a request it made or received was approved, declined, paid, cancelled or expired. Called by Its home switch. Defined in PSP-14.10, PSP-14.11, PSP-13.5, PSP-15.5.

RequestTypeRequiredMeaningClause
status"approved" | "declined" | "expired" | "cancelled" | "paid"yesThe request's new status.PSP-14.11
reportbooleanTrue when the payer declined and reported the request as unwanted.PSP-13.8
side"payer"payer when the request was answered elsewhere, so the copy this app received is done too.PSP-15.5
ResponseTypeRequiredMeaningClause
idstringyesThe request's id.
status"approved" | "declined" | "expired" | "cancelled" | "paid"yesThe status as received.

Errors

14.5 Money arrived

  • PSP-14.12 Body { "payment": { "id", "to_address", "from_address", "from_name", "from_country", "amount", "note", "collect_request_id", "completed_at" } }. It is sent after the payee’s bank has been credited, by the switch of the payee account’s country. The money has moved whether or not the provider hears.
  • PSP-14.13 The provider MUST record the payment once per id and, when collect_request_id is set, mark its own request paid. If the address is gone it MUST still answer success. The reference answers { "ok": true, "known": <bool> }.
  • PSP-14.14 A switch sends this call once, as best effort. A provider MUST NOT treat a missing call as a missing payment.
POST /switch/v1/payments/received Money arrived · served by a provider

Tells the app a payment reached one of its addresses; sent once, best effort, after the payee's bank was credited. Called by the switch of the payee account's country, through the app's home switch. Defined in PSP-14.12, PSP-14.13, PSP-14.14, PSP-15.4.

RequestTypeRequiredMeaningClause
paymentobjectyesThe payment, as the switch describes it to the payee's app.PSP-14.12
payment.idstring, uuidyesThe id of the request or payment (a UUID). The same id is used by every party; a repeat with it changes nothing.PSP-14.5
payment.to_addressstringyesThe address the money was paid to: one this app issued (or its bank's, for a bank's own app).
payment.from_addressstringyesThe payer's payment address.
payment.from_namestring, nullyesThe payer's name, as their bank or app holds it.
payment.from_countrystringyesThe payer's country, an ISO 3166 two-letter code. (pattern ^[A-Z]{2}$)
payment.amountobjectyesThe amount credited, in the payee's currency.
payment.amount.valuestringyesA decimal string, such as "250.00". Never a float. (pattern ^-?\d+(\.\d{1,2})?$)
payment.amount.currencystringyesISO 4217 code, such as INR or USD. (pattern ^[A-Z]{3}$)
payment.notestring, nullyesFree text from the payer, at most 140 characters. (at most 140 characters)
payment.collect_request_idstring, null, uuidyesThe request this payment answers; the app marks its own request paid.PSP-14.13
payment.completed_atstring, null, date-timeyesWhen the payment completed.
ResponseTypeRequiredMeaningClause
okbooleanyesAlways true: the app answers success even when the address is gone.PSP-14.13
knownbooleanyesFalse when the address no longer exists at the app.PSP-14.13

Errors

15. A bank’s own app

A bank can add its own app without changing anything it already does. The app is a provider that acts for the bank (PSP-3.4). The bank keeps its handle and its addresses.

  • PSP-15.1 A bank’s own app issues no addresses. Each account it connects comes with the address the bank issued (address at link, PSP-8.10), and it MUST use that address. It MUST refuse to create or re-point addresses.
  • PSP-15.2 A bank’s own app SHOULD offer only its own bank for connect.
  • PSP-15.3 At the switch of its bank’s country, a bank’s own app MAY use its bank’s addresses as from_address and as payee_address, but only for accounts at that bank. A switch MUST grant this only while the bank is active, of kind bank, in the switch’s country, and has a handle.
  • PSP-15.4 Addresses under the bank’s handle still resolve at the bank. Money to them still goes to the bank. A switch MUST then also tell the bank’s own app (PSP-14.12).
  • PSP-15.5 A request for money to one of the bank’s addresses goes to the bank as before. A switch MUST also send a copy to the bank’s own app (PSP-14.8). Either may answer it. When one pays or declines, the switch MUST tell the other with side payer, so its copy stops waiting.
  • PSP-15.6 A bank with no app MUST see no change at all.

16. What a provider must never do

  • PSP-16.1 A provider MUST NOT hold money, keep a balance of its own, or act as the account of any payment.
  • PSP-16.2 A provider MUST NOT read, decrypt, store or log a PIN or a PIN message. It MUST NOT hold any bank’s PIN private key. The reference has a development-only endpoint that encrypts a PIN on the server for test scripts; a provider MUST NOT expose such an endpoint outside a local machine.
  • PSP-16.3 A provider MUST NOT call a bank. Every call to a bank goes through the switch.
  • PSP-16.4 A provider MUST NOT call any switch but its home switch (PSP-4.1), and MUST NOT accept a call from any other (PSP-14.2).
  • PSP-16.5 A provider MUST NOT store an account number. It knows an account only by its reference and the masked form.
  • PSP-16.6 A provider MUST NOT issue or speak for addresses under a handle that is not its own, except as a bank’s own app (§15).
  • PSP-16.7 A provider MUST NOT forward a person’s access token to anyone but its home switch, and only as identity_token for bank connect. Presenting the token back to the issuer that made it, to read the person’s own claims at <iss>/userinfo, is not forwarding and is allowed.

17. Worked example

Wren (provider:wren, home IN, handle wren) at https://api.wren.example. The IN switch (switch:IN) at https://switch.in.example. Signatures and idempotency headers are shown by name only.

Registry entries:

{ "id": "provider:wren", "kind": "provider", "country": "IN", "display_name": "Wren", "address_suffix": "wren",
  "base_url": "https://api.wren.example", "jwks_url": "https://api.wren.example/.well-known/jwks.json", "status": "active", "acts_for": null }
{ "id": "provider:sbi", "kind": "provider", "country": "IN", "display_name": "SBI Pay", "address_suffix": null,
  "base_url": "https://pay.sbi.example", "jwks_url": "https://pay.sbi.example/.well-known/jwks.json", "status": "active", "acts_for": "bank:sbi" }

17.1 Asha connects SBI

Asha signs in to Wren at Wren’s OCI-ID. Wren asks the IN switch, because SBI is in IN:

POST https://switch.in.example/v1/connect/accounts      OCI-Signature (iss provider:wren)
{ "bank": "bank:sbi", "identity_token": "eyJ...asha-access-token" }

The switch passes { "provider": "provider:wren", "identity_token": "eyJ..." } to SBI. SBI checks the token, asks the issuer for Asha’s phone, and answers:

{ "bank": "bank:sbi", "bank_name": "State Bank", "country": "IN",
  "accounts": [ { "id": "6f1c...offer", "kind": "savings", "masked": "**** 4321", "currency": "INR", "holder_name": "Asha Rao", "linked": false } ],
  "pin_key": { "kty": "EC", "crv": "P-256", "x": "...", "y": "...", "kid": "sbi-pin-1", "alg": "ECDH-ES", "use": "enc" } }

Asha picks the account and types her PIN. Her phone encrypts { "pin": "1234", "nonce": "9b2e...", "iat": 1795000000 } to pin_key.

POST https://switch.in.example/v1/connect/link
{ "bank": "bank:sbi", "account_id": "6f1c...offer", "pin": "eyJhbGciOiJFQ0RILUVTIi..." }

SBI checks the PIN, records that Wren may use the account, and answers with "account": "Qm9...ref", "assurance": "substantial", "address": "asha@sbi" and the masked account. Wren keeps the reference and the PIN key, and Asha chooses asha@wren for it.

17.2 Asha pays ravi@wren

Wren looks the payee up at the IN switch (POST /v1/lookup {"address": "ravi@wren"}). The switch asks Wren itself:

POST https://api.wren.example/switch/v1/resolve      OCI-Signature (iss switch:IN)
{ "address": "ravi@wren" }
→ { "address": "ravi@wren", "name": "Ravi Menon", "assurance": "substantial", "bank": "bank:hdfc", "account": "aGQ...ref" }

cross_border is false, so no quote. Asha’s phone makes a new PIN message.

POST https://switch.in.example/v1/payments           OCI-Signature, Idempotency-Key: 0d6a6a3e-...
{ "id": "0d6a6a3e-...", "from_address": "asha@wren", "from_name": "Asha Rao", "to_address": "ravi@wren",
  "amount": { "value": "120.00", "currency": "INR" }, "note": "lunch", "quote_id": null, "collect_request_id": null,
  "payer": { "bank": "bank:sbi", "account": "Qm9...ref" }, "credential": "eyJhbGciOiJFQ0RILUVTIi..." }

The switch has SBI hold the money with the PIN, credits Ravi’s HDFC account by Wren’s reference, has SBI take the held money, and answers "status": "completed". Then it tells Wren that money arrived at ravi@wren:

POST https://api.wren.example/switch/v1/payments/received      OCI-Signature (iss switch:IN)
{ "payment": { "id": "0d6a6a3e-...", "to_address": "ravi@wren", "from_address": "asha@wren", "from_name": "Asha Rao",
  "from_country": "IN", "amount": { "value": "120.00", "currency": "INR" }, "note": "lunch", "collect_request_id": null,
  "completed_at": "2026-11-28T10:00:02+00:00" } }
→ { "ok": true, "known": true }

17.3 Lena’s Chase account, from Wren, through the IN switch

Lena uses Wren. Her account is at Chase, in the US. Wren calls only the IN switch, so it relays:

POST https://switch.in.example/v1/relay              OCI-Signature (iss provider:wren)
{ "country": "US", "method": "POST", "path": "/v1/connect/accounts",
  "body": { "bank": "bank:chase", "identity_token": "eyJ...lena-access-token" } }

The IN switch passes it over the link to the US switch (OCI-PAY-4). The US switch checks that Wren’s home is IN, runs the call as Wren, and Chase’s answer comes back unchanged. Linking and payments go the same way. A payment from lena@wren is a relay of /v1/payments with Idempotency-Key on the relay; the payment is kept by the US switch, in USD. Reading it later:

POST https://switch.in.example/v1/relay
{ "country": "US", "method": "GET", "path": "/v1/payments/5e0c...", "body": null }

18. Security considerations

  • The PIN. It is encrypted on the device to the bank’s key (PSP-8.6). The provider and the switches carry it and cannot read it. The bank refuses a replayed nonce and a stale iat (PSP-8.9), so a captured PIN message is useful for at most 300 seconds and only once. The switch does not keep it (PSP-11.9).
  • The access token travels. For bank connect the person’s access token passes through the home switch, perhaps the other switch, and reaches the bank, which uses it at the issuer. Anyone on that path can use it as a bearer token until it expires. Keep tokens short-lived. Sender-constrained tokens (OCI-2 DPoP) would stop this use, and also stop the bank from calling /userinfo with it (§21).
  • The token is not bound to the provider. A bank checks the token’s client id against the client ids it accepts, not against the provider the switch names. A provider could pass a token issued to another app with an accepted client id. The PIN check at link (PSP-8.9) is what stops it from linking an account it was not given.
  • One home switch. A provider accepts only its home switch (PSP-14.2), so a compromised switch of another country cannot call it directly. It still reaches the provider through the link, re-signed by the home switch. The home switch is trusted with everything the provider hears.
  • Account references. A reference works only for the provider it was given to (PSP-8.12), so a leaked reference is no use to anyone else. A leaked provider signing key is: rotate it (CORE-5.6).
  • Replay. A signature is valid for 120 seconds and carries no jti. State-changing calls rely on idempotency (PSP-5.3, PSP-14.5) for safety against replay.
  • Enumeration. Resolve says whether an address exists and the holder’s name. Only the home switch may ask (PSP-14.2), which limits who can enumerate. Nothing in the reference rate-limits it.
  • Development endpoints. The reference’s PIN-encrypting endpoint (PSP-16.2) defeats the PIN model. It is off unless a local flag is set.

19. Privacy considerations

  • A provider holds names, addresses, masked accounts and payment history for its own addresses only (PSP-10.3). It never holds an account number (PSP-16.5).
  • A bank learns which providers a customer linked. The switch learns which provider started each payment. Neither learns the other provider’s addresses for the same account.
  • Resolve returns the holder’s name to the paying side, for payer confirmation (OCI-PAY-1).
  • Finding accounts by phone (PSP-7.5) means the bank learns that this phone signed in at this provider. The bank lists accounts only to the provider that asked, masked (PSP-8.4).
  • Logs follow CORE-7.3: no PIN messages, no access tokens, no account references in clear text.

20. Conformance

An implementation conforms to OCI-PAY-3 0.1 as a provider when it meets every PSP clause addressed to a provider, and as a switch or bank when it meets those addressed to it. The reference tests below cite behaviour, not clause numbers yet.

ClausesChecked by
PSP-4.1, 4.2, 6.1, 6.7, 6.8wren-api/tests: the fake switch fails any direct call to a foreign switch (conftest.py); test_connecting_asks_the_switch_of_the_banks_country_and_passes_the_sign_in_on
PSP-4.3, 4.5, 6.2 to 6.4ocipay-api/tests/test_providers.py: test_a_us_app_is_refused_by_the_indian_switch, test_what_may_be_relayed, test_what_a_provider_may_and_may_not_send
PSP-4.6test_the_indian_switch_reaches_a_us_app_only_through_the_us_switch, test_a_request_for_money_reaches_a_us_app_through_its_home_switch, test_the_link_forwards_only_to_an_app_registered_here
PSP-7.1, 7.2test_a_sign_in_from_an_accepted_identity_becomes_a_user_once, test_the_same_person_through_another_client_is_the_same_user, test_other_tokens_are_refused
PSP-8.xtest_bank_connect_is_relayed_to_the_bank_with_the_providers_name, test_bank_connect_errors, test_an_app_connects_a_bank_in_the_other_country_through_its_home_switch, test_linking_stores_the_banks_reference_and_never_an_account_number, test_an_account_connected_by_someone_else_is_refused
PSP-9.x, 8.17test_balance_is_asked_of_the_bank_and_disconnect_frees_the_address
PSP-11.xtest_a_provider_payment_holds_at_the_payers_bank_credits_and_then_takes_the_money, test_a_wrong_pin_fails_the_payment_and_nobody_is_credited, test_a_debit_the_bank_never_got_cannot_be_retried_without_the_pin, test_a_provider_payment_across_the_border_debits_the_amount_and_the_fee, test_an_app_pays_from_an_account_in_the_other_country_and_the_payment_stays_there; Wren: test_a_payment_goes_to_the_switch_with_the_account_reference_and_the_pin, test_a_wrong_pin_is_asked_again_and_leaves_no_payment, test_no_answer_from_the_switch_stays_pending_and_is_asked_about_later, test_a_payment_abroad_needs_its_quote_and_carries_the_fee
PSP-12.2test_a_provider_reads_its_own_payments_and_no_one_elses
PSP-13.xtest_a_provider_asks_for_money_for_its_own_address, test_a_request_to_a_provider_address_is_approved_by_paying_it, test_a_provider_declines_a_request_and_the_payee_bank_is_told; Wren: test_a_request_from_someone_arrives_is_approved_by_paying_or_declined, test_asking_someone_for_money_and_hearing_how_it_ended
PSP-14.1 to 14.4Wren: test_only_a_switch_may_ask (unsigned, a bank, a foreign switch, a stranger’s key)
PSP-14.6, 14.7test_lookup_asks_the_provider_and_never_the_bank, test_an_address_the_provider_does_not_have_is_not_found, test_a_provider_that_does_not_answer_is_a_503; Wren: test_resolve_answers_a_switch_with_the_bank_and_the_reference
PSP-14.12, 14.13test_the_app_that_issued_the_payee_address_is_told_the_money_arrived; Wren: test_money_that_arrives_shows_in_history
PSP-15.xocipay-api/tests/test_bank_app.py (all eight tests, including test_a_bank_with_no_app_is_told_nothing_new); Wren: test_a_banks_own_app_uses_the_address_the_bank_issued, test_a_request_answered_at_the_bank_stops_waiting_in_its_app
PSP-3.xstores/oci/scripts/oci-wiring.py · participants (registration rules). Not tested in code.
PSP-5.6, 5.7, 14.5, 16.xNot checked by a test that names them. A conformance harness against a running provider is planned.

21. Open questions

Divergences between the code, the drafts and the plans:

  • Signature algorithm. The OCI-Signature in the code is EdDSA (Ed25519), with no typ. CORE-5.1 requires ES256 (or PS256) and CORE-5.2 rejects all others; CORE-5.4 requires typ. The switch’s kid is the first 16 characters of the thumbprint, not the whole one (CORE-5.3 SHOULD). OCI-PAY-2 §4 owns the signature; GAPS.md already records the first two.
  • Error envelope. Every reference service answers { "error": { "code", "message" } }. CORE-9.1 says { "error", "error_description" }. GAPS.md records this for OCI-0.
  • Sign-in is not OCI-2 as written. The provider and the bank verify access tokens with keys from <iss>/jwks.json and a configured issuer list, not through OCI-1 resolution (AUTH-3.1). The tokens are bearer tokens, not DPoP-bound (AUTH-7.5, AUTH-8.5). The provider forwards the token, and the bank uses it at the issuer’s /userinfo to get phone_number (and the provider gets email); AUTH-7.6 says an OCI-2 access token grants nothing beyond identity. phone_number_verified is not checked; “verified” rests on the issuer. Decide whether bank connect needs an OCI-3 release of the phone, or a signed statement from the identity (plan 005 says “the identity’s signed statement of who they are”).
  • Which client ids a bank accepts. The bank checks client_id against a fixed list (wren-web, wren-mobile, wren-app), the reference app’s ids, whatever provider calls. A second provider that is not Wren’s code needs its ids added to every bank. The token is not bound to the provider the switch names (§18).
  • Which identities a bank trusts is set by configuration in the store wiring (provider_identities()), not read from the registry. Plan 005 lists this as open.
  • No consent receipt. Plan 005 says “the bank records the consent”. It is a row at the bank (paybank.provider_links). The person gets no OCI-5 receipt, and there is no status or withdrawal endpoint. Should bank connect issue an OCI-5 receipt?
  • The bank cannot tell the provider a link ended. Plan 005 says “either side can end it”. The connector has no bank-side unlink route, and no call tells the provider. The provider learns from PROVIDER_NOT_ALLOWED (PSP-8.18).
  • Reference scope. Plan 005 says the reference is “only this provider can use, for this person”. The code gives one reference per provider and account, not per person. Two people at one provider cannot both link a shared account (Wren answers ACCOUNT_CONNECTED_ELSEWHERE).
  • Balance without a PIN (PSP-9.3) follows plan 005 decision 4. UPI asks for the PIN.
  • PIN length and JWE. The code takes 4 to 6 digits. oci-9-payments.yaml and GAPS.md say 4 to 8. The code takes enc A256GCM only, a subset of CORE-5.8. CORE-5.8 speaks of encrypting a JWT; the PIN message is a JWE over plain JSON with no exp, and its 300-second iat window is wider than CORE-6.2’s 60-second skew.
  • The drafts predate providers. oci-9-payments.yaml and oci-9-payments-switch.yaml follow plan 003: the wallet calls its own bank’s /v1/me, /v1/payments and so on with an OCI-ID token. They have no provider kind, no bank connect, no relay, no payer/credential, no debit and no /switch/v1/resolve. Plan 005 replaced that model. The bank connector still serves those wallet routes (ocipay-bank-api/app/routers/wren.py, “Endpoints for Wren”, accepting the Wren client ids); they are now the bank’s own customer channel, and PSP-16.3 forbids a provider to use them. The router’s name and the accepted client ids should be changed.
  • The OCI-9 proposal (now OCI-PAY-1) against the code. PAY-4.1 calls for a role/payment_address_provider trust mark; the code uses the registry’s kind provider and no trust mark. PAY-5.1 gives resolution a purpose; the code has none. PAY-5.4 requires signed, short-lived resolution answers; resolve answers plain JSON. PAY-5.5 requires rate limits; there are none. PAY-6.1 binds an address at substantial only after OCI-3 or OCI-4; the code takes assurance from the bank at link. PAY-6.2 (OCI-7 suspension) is not built. OCI-PAY-1 owns these; this spec follows the code.
  • A handle has no country, a provider does. Plan 005 decision 1 said a provider belongs to no country; plan 010 gave it a home. The handle is still global and an address may point at an account in either country (PSP-10.5).
  • Calls to a provider carry no Idempotency-Key. net.to_provider is called without one and /link/v1/to-provider does not forward one. Providers dedupe by id (PSP-14.5). Should the switch send one?
  • paid carries no payment_id. GAPS.md says the spec requires payment_id with paid; the switch sends { "status": "paid" } only.
  • Money arriving is best effort. payments/received is sent once with no retry (PSP-14.14), and a payee’s provider cannot read a payment it did not start (PSP-12.2: only the payer’s provider may). A provider that missed the call has no way to learn of the payment. Should the payee’s provider be allowed to read it, or the call be retried?
  • Unused and extra members. The request delivery carries payee_country and created_at, which Wren ignores. Wren accepts an fx member on payments/received that the switch never sends; a payee abroad cannot see the rate.
  • One app per bank. trust.agent_of takes the first provider whose acts_for names the bank. The registry does not stop two. Should acts_for be unique?
  • htu and base_url. A provider checks htu against its own configured PUBLIC_BASE_URL, not against its registry base_url. They must agree (PSP-3.6); nothing checks that.
  • Quotes and the account’s country. For a quote the switch checks only that from_address is under the caller’s handle, not that the paying account is in its country. A wrong-switch quote is caught only when the payment is refused.
  • Idempotency across a relay. At the other switch a relayed call’s idempotency scope includes /link/v1/relay, and the body is compared in sorted-key form. A call made once directly and once through a relay is not recognised as the same. OCI-PAY-4 owns this.
  • Failure classes. PSP-5.7 is the reference provider’s rule. OCI-PAY-2 states the switch’s (SW-10.2), and the two differ: the switch counts 408, 429 and other 409s as refusals, the provider as unknown. One rule should hold for every participant.

Changes

VersionDateWhat changed
0.1.02026-11-28First version, extracted from the reference implementation. Numbered OCI-PAY-3 in the payments family (first drafted as OCI-14). PSP-16.7 allows presenting the token to its own issuer’s /userinfo. Message tables for each call.