# Fiat instructions

Use these API operations to pre-declare an incoming fiat payment, obtain the memo that
correlates it to the resulting mint, and read the Ripple bank account to send it to.

| Operation | Method | Description |
| --------- | ------ | ----------- |
| [Create a buy instruction](#operation/createFiatInstruction) | PUT | Declare an incoming fiat payment under an id you choose, and receive the memo to quote on it. |
| [Get a fiat instruction](#operation/getFiatInstruction) | GET | Get a specific instruction, buy or redemption, by ID. |
| [List fiat instructions](#operation/listFiatInstructions) | GET | Get a paginated list of your instructions. |
| [Delete a buy instruction](#operation/deleteFiatInstruction) | DELETE | Retire an unused buy instruction. |
| [Get bank details](#operation/getFiatBankDetails) | GET | Get the Ripple bank account to wire the fiat to, on its own. |


## Get bank details

 - [GET /v1/stablecoin/fiat-bank-details](https://docs.ripple.com/products/stablecoin/api/reference/rlusd-openapi/fiat-instructions/getfiatbankdetails.md): Returns the Ripple bank account to wire fiat to when buying stablecoin - the same object
embedded as bankDetails on every fiat instruction, served on its own.

The bank belongs to your account rather than to any one instruction, so this is the endpoint
to call when you want the wire destination without creating or listing an instruction:
rendering a "where to send funds" panel, caching the details, or checking them on a
schedule.

This endpoint does not return a memo. A memo is per-payment and comes only from a fiat
instruction; the bank details alone are not enough to have a payment attributed. Create an
instruction for every payment you intend to send.

Unlike the embedded bankDetails field, which is simply absent on any failure so that the
instruction and its memo still come back, this endpoint keeps its failures apart: a 404 is
a settled answer and retrying will not change it, a 502 is transient.

## List fiat instructions

 - [GET /v1/stablecoin/fiat-instructions](https://docs.ripple.com/products/stablecoin/api/reference/rlusd-openapi/fiat-instructions/listfiatinstructions.md): Returns a paginated list of your fiat instructions, both buy (CRYPTO destination) and
redemption (FIAT destination). Deleted instructions are excluded.

bankDetails is identical on every instruction in the page - it is resolved from your
account, not from the instruction row.

## Create a buy instruction

 - [PUT /v1/stablecoin/fiat-instructions/{id}](https://docs.ripple.com/products/stablecoin/api/reference/rlusd-openapi/fiat-instructions/createfiatinstruction.md): Declares an incoming fiat payment under an id you choose, and returns the memo to quote in
that payment's reference field so the funds can be attributed and the RLUSD minted to the
wallet you named.

You generate the UUID for {id} client-side and it becomes the instruction's identity.
Reusing an id that already exists is rejected with a 409 carrying code
FIAT_INSTRUCTION_ALREADY_EXISTS.

Only a CRYPTO destination may be created here. Redemption (FIAT) instructions are
created by Ripple when your redemption is registered, and are read-only to you.

> Put the memo verbatim into the payment's reference field, and nothing else. A
> RIPxxxxxxx wallet ripId token in the payment's free text takes precedence over a memo
> during matching, which would credit that wallet and leave this instruction UNUSED.

## Get a fiat instruction

 - [GET /v1/stablecoin/fiat-instructions/{id}](https://docs.ripple.com/products/stablecoin/api/reference/rlusd-openapi/fiat-instructions/getfiatinstruction.md): Returns a single fiat instruction by id, including its memo and current status. Works for
both buy and redemption instructions belonging to your account.

Only your own instructions are visible. An id belonging to another customer, a deleted
instruction, and an id that never existed are all reported as
404 FIAT_INSTRUCTION_NOT_FOUND.

## Delete a buy instruction

 - [DELETE /v1/stablecoin/fiat-instructions/{id}](https://docs.ripple.com/products/stablecoin/api/reference/rlusd-openapi/fiat-instructions/deletefiatinstruction.md): Retires a buy instruction you no longer intend to use, so a fiat payment arriving later with
its memo can never mint against it. Because instructions never expire, this is the only way
to retire an unused one - an abandoned instruction left alone stays UNUSED and claimable
indefinitely.

Deletion is permanent and there is no un-delete: create a new instruction with a new id,
which gets a new memo. Transactions already produced from the instruction are unaffected and
keep their fiatInstructionId and memo.

Only your own UNUSED buy instructions can be deleted. A redemption (FIAT) instruction is
reported as 404, since this operation only addresses your CRYPTO instructions.

