POST
/
api
/
partner
/
v1
/
off-ramp
cURL
curl --request POST \
  --url https://staging-api.capa.fi/api/partner/v1/off-ramp \
  --header 'Content-Type: application/json' \
  --header 'partner-api-key: <partner-api-key>' \
  --header 'x-supported-country: <x-supported-country>' \
  --data '{
  "userId": "8374f327-38bd-4b0b-b8a7-2524599eb903",
  "fromAmount": 10200,
  "blockchainToTokenId": "8374f327-38bd-4b0b-b8a7-2524599eb903",
  "userBankInformationId": "8374f327-38bd-4b0b-b8a7-2524599eb969",
  "fiatCurrencyId": "5f9d37f5-c2f4-4e7e-8bb4-e0d2a1442252",
  "premiumSpread": 0.01
}'
{
  "status": "ok",
  "data": {
    "id": "<string>",
    "userId": "<string>",
    "status": "<string>",
    "fromAmount": 123,
    "blockchainToTokenId": "<string>",
    "fiatCurrencyId": "<string>",
    "exchangeRate": 123,
    "type": "<string>",
    "walletAddress": "<string>"
  }
}

Headers

x-supported-country - Country code of the flow (MX or DO) PartnerApiKey (string) - API key associated with the partner.
Partner API Key RequiredRequires partner-api-key for authentication to ensure only authorized partners can access this data.See 🔑 API Key Generation Guide for getting your API key

Parameters

  • userId (string) - Id from the user the transaction is going to be created on behalf of
  • fromAmount (number) - The amount of crypto to be converted to fiat. The amount of fiat to be received can be calculated with the Off Ramp Quoter
  • blockchainToTokenId (string) - Refers to the blockchain-to-token id for on-ramp transactions. See Blockchain to Token docs for more information on how to retrieve the Blockchain to token id.
  • userBankInformationId (string) - Is the id of the user bank information, to retrieve a users bank information use Get Off Ramp User Bank Information. If a user does not have any bank information use the following endpoint to create one Create Off Ramp User Bank Information
  • fiatCurrencyId (string) - Refers to the blockchain to token used for the off-ramp transaction. See Blockchain To Token docs for more information on how to retrieve the blockchain to token id.

Response Body

  • id(string) - Transaction Id
  • userId(string) - Id from the user the transaction was created on behalf of
  • status (string) - The status of the transaction which at the time of the creation should equal to PENDING
  • fromAmount The amount of crypto being off ramped
  • fiatCurrencyId(string) - Fiat Currency Id chose for the transaction
  • tokenBlockChainId(string) - Token to Blockchain id chose for the transaction
  • type(string) If it is an OFF_RAMP or ON_RAMP

Example


{
  id: "b1c2d3e4-f5g6-h7i8-j9k0-l1m2n3o4p5q6",
  userId: "8f48c371-24e5-4f63-9589-f4f1d2921635",
  cryptoAmount: 50,
  status: "PENDING",
  tokenBlockChainId: "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",
  fiatCurrencyId: "dd4f872b-3221-4a20-8eff-80149278ec35",
  type: "OFF_RAMP"
}

Use Cases

  • Execute Off-Ramp Transaction: Create off ramp transaction in behalf of a user with the parameters selected.

Headers

x-supported-country
string
required

Country code of the flow (MX or DO)

partner-api-key
string
required

Api key for the affiliated partner that is performing the request

Body

application/json
userId
number
required

Identifier for the user who's submitting the off-ramp order

Example:

"8374f327-38bd-4b0b-b8a7-2524599eb903"

fromAmount
number
required

Amount of crypto currency to be converted to fiat currency.

Example:

10200

blockchainToTokenId
string
required

Identifier for the blockchain to token from which the conversion will be made.

Example:

"8374f327-38bd-4b0b-b8a7-2524599eb903"

userBankInformationId
string
required

Identifier for a bank information belonging to the user submitting the off ramp request.

Example:

"8374f327-38bd-4b0b-b8a7-2524599eb969"

fiatCurrencyId
string
required

Identifier for the fiat currency which the user will rec.

Example:

"5f9d37f5-c2f4-4e7e-8bb4-e0d2a1442252"

premiumSpread
number

Spread percentage to be applied to the exchange rate

Example:

0.01

Response

201 - application/json
status
string
Example:

"ok"

data
object