# PIP-0023 · Rail profiles: SEPA Instant and PI-SPI

The profiles of `sepa-inst` and `pi-spi`, an annex to PIP-0003. Both rails are `profiled`: beneficiary formats taken from the endpoint formats of the register, the fields each format requires, rail reference types, the remittance field as `payment_reference`, and the rows that do not translate.

## Why

A payment instruction ([PIP-0009](/pips/0009)) is issued only on a rail with a beneficiary format. A `reserved` rail has none ([PIP-0007](/pips/0007)), so a payee whose member credits it on an instant fiat rail cannot be given a destination. This PIP is an annex to [PIP-0003](/pips/0003): it publishes the profiles of `sepa-inst` and `pi-spi`, and both rails become `profiled`.

## Beneficiary formats on a profiled rail

On a profiled rail other than `blockchain` and `book`, a beneficiary format is the id of an endpoint format of the register ([PIP-0019](/pips/0019)), linked to the rail's network with that rail in `rails` and with the status `live`. Its syntax, its offline checks and the fields it requires come from that link.

These formats carry `beneficiary_format: null` in the register: the id of the format is the beneficiary format. `chain_address` on `blockchain` and `path_address` on `book` keep the rule of PIP-0019.

An alias or proxy service over a rail is not a beneficiary format. Wero, the SEPA Proxy Lookup and the TIPS mobile proxy over `sepa-inst`, and the PI-SPI aliases over `pi-spi`, are identifiers in PATH ID and FINDER. A payer resolves them before it asks for an instruction; an instruction names the account.

## The beneficiary of an instruction

On a profiled rail other than `blockchain` and `book`, the `beneficiary` of an instruction is:

```json
{
  "format": "iban",
  "value": "DE89370400440532013000",
  "fields": { "holder_name": "Erika Mustermann" }
}
```

| Member | Rule |
|---|---|
| `format` | One of the rail's `beneficiary_formats` |
| `value` | The identifier, in the normalized form of the format. It passes the offline checks of the format and of its link |
| `fields` | The fields of the format on that network, by name. Every field the link marks `always` is present; an `optional` field is present when the payee's member holds it. No other name |

`blockchain` and `book` instructions carry `{ format, value }`, without `fields`.

## SEPA Instant: `sepa-inst`

| PATH | Rail |
|---|---|
| PATH ID | The scheme carries no customer reference. Aliases over the rail (Wero, SEPA Proxy Lookup, TIPS mobile proxy) are identifiers of PATH ID and FINDER, not part of the rail mapping |
| PATH ADDRESS — capability | `{ "rail": "sepa-inst", "asset_type": "fiat", "asset_code": "EUR" }` |
| PATH ADDRESS — instruction | Beneficiary format `iban`. Fields: `holder_name` (always), `bic` (optional). The unstructured remittance information, 140 characters, is `payment_reference` |
| PATH REQUEST | Not carried. The sources of this profile describe no request-to-pay service for the rail: `request_overlay` is `null` |
| PATH CONNECT | Not carried. The scheme defines no mandate for a credit transfer: the payer instructs its own institution |
| PATH SETTLEMENT | `end_to_end_id`: the originator's reference of the transaction. `tx_id`: the originator institution's reference of the transaction. `scheme_reference`: any other identifier the scheme assigned. The UETR is not carried by this profile |
| Finality | Out of scope of this version |

Sources: the SEPA Credit Transfer and SEPA Instant Credit Transfer rulebooks of the European Payments Council, and the IBAN standard (ISO 13616), as cited by the `iban` format of the register.

## PI-SPI: `pi-spi`

| PATH | Rail |
|---|---|
| PATH ID | The scheme carries no customer reference. The PI-SPI aliases (`pi-spi-shid`, `pi-spi-mbno`, `pi-spi-mcod`) are identifiers of PATH ID and FINDER, resolved through the directory of the network, not part of the rail mapping |
| PATH ADDRESS — capability | `{ "rail": "pi-spi", "asset_type": "fiat", "asset_code": "XOF" }` |
| PATH ADDRESS — instruction | Beneficiary formats `uemoa-iban` and `uemoa-account`. Fields: `participant` (always), the member code of the receiving participant; `holder_name` (always) with `uemoa-iban`. The payment reason (`motif`), 140 characters, is `payment_reference` |
| PATH REQUEST | Not carried. The sources of this profile describe no request-to-pay service for the rail: `request_overlay` is `null` |
| PATH CONNECT | Not carried. The scheme defines no mandate for a credit transfer: the payer instructs its own participant |
| PATH SETTLEMENT | `end_to_end_id`: the scheme's end-to-end identifier (`end2endId`). `tx_id`: the transaction identifier the payer's side assigns (`txId`). `scheme_reference`: any other identifier the scheme assigned |
| Finality | Out of scope of this version |

Sources: the PI-SPI developer documentation of the BCEAO (payment sending guide, payment schemas), as cited by the `uemoa-iban` and `uemoa-account` formats of the register.

## Rail entries

| Field | `sepa-inst` | `pi-spi` |
|---|---|---|
| `status` | `profiled` | `profiled` |
| `beneficiary_formats` | `iban` | `uemoa-iban`, `uemoa-account` |
| `rail_reference_types` | `end_to_end_id`, `tx_id`, `scheme_reference` | `end_to_end_id`, `tx_id`, `scheme_reference` |
| `payment_reference_max` | 140 | 140 |
| `request_overlay` | `null` | `null` |
| `profile` | `PIP-0023` | `PIP-0023` |

The networks `sepa-inst` and `pi-spi` take the status of their rail. Every rail entry carries `request_overlay` and `profile`: `blockchain` and `book` name `PIP-0007`; a reserved rail has `null` in both.

## Receive targets

A receive target on a profiled rail other than `blockchain` and `book` names its beneficiary: `beneficiary_format`, `beneficiary` and `beneficiary_fields`. The value passes the offline checks of the format and of its link, and every field the link marks `always` is present. Otherwise the call fails with 400 `path.core.malformed_request`, and `detail.field` names the member at fault (`beneficiary_format`, `beneficiary`, `beneficiary_fields.holder_name`).

```json
{
  "rail": "sepa-inst",
  "asset_type": "fiat",
  "asset_code": "EUR",
  "account_kind": "external_account",
  "account_ref": "acct_7d1f",
  "beneficiary_format": "iban",
  "beneficiary": "DE89 3704 0044 0532 0130 00",
  "beneficiary_fields": { "holder_name": "Erika Mustermann" }
}
```

The target is stored with the value in its normalized form. `account_ref` stays with the payee's member.

## Interface

| Call | Change |
|---|---|
| `GET /registers/rails`, `GET /registers/networks/{slug}?expand=rails` | Every rail carries `request_overlay` and `profile`. `sepa-inst` and `pi-spi` answer `profiled` with their formats and reference types |
| `POST /addresses/{id}/targets` | Takes `beneficiary_fields`. Required on `sepa-inst` and `pi-spi`, with `beneficiary_format` and `beneficiary` |
| `GET /addresses/{id}/targets` | A grammar-2 target carries `beneficiary_fields`, `{}` where the rail takes none |
| `POST /instructions` | On `sepa-inst` and `pi-spi`, `beneficiary` is `{ format, value, fields }` |

## Compatibility

Capabilities, standing intents and commitments are unchanged: `sepa-inst` and `pi-spi` keep their identifiers. A receipt on these rails may carry `end_to_end_id` and `tx_id` in `rail_references`. A receive target on these rails without a beneficiary serves no instruction: the call fails with 409 `path.instruction.destination_unavailable`.

Signed instructions on `blockchain` and `book` keep their shape.

## Implementation

The reference implementation serves both profiles in the rail register, checks receive targets against the endpoint formats of the register, and issues instructions with `beneficiary.fields`. Migration `039_rail_profiles.sql` carries the rail entries and the beneficiary fields of receive targets.