Skip to main content
POST
/
api
/
v1
/
sellAndPays
Create Sell and Pay transaction
curl --request POST \
  --url https://skala-sandbox.ripio.com/api/v1/sellAndPays \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "customerId": "b6cecc1f-c90d-424b-adaa-c82b780696c1",
  "externalRef": "sp-12345-2024",
  "qrCode": "00020101021226360014BR.GOV.BCB.PIX0114+55119876543215204000053039865802BR5913Store Name XYZ6009SAO PAULO62070503***6304ABCD",
  "paymentCurrency": "ARS",
  "depositCurrency": "USDC",
  "depositNetwork": "ETHEREUM",
  "refundAddress": "0x4e88BBeFF059BDDF5BF90ee0816E86eDf4214b32"
}'
{
  "id": "a3b2c1d0-1234-5678-90ab-cdef12345678",
  "createdAt": "2024-01-26T12:45:00.078230Z",
  "expiresAt": "2024-01-26T13:45:00.078230Z",
  "customerId": "b6cecc1f-c90d-424b-adaa-c82b780696c1",
  "trade": {
    "id": "<string>",
    "createdAt": "2023-11-07T05:31:56Z",
    "externalRef": "<string>",
    "customerId": "<string>",
    "quoteId": "<string>",
    "txnId": "<string>",
    "baseAsset": "<string>",
    "quoteAsset": "<string>",
    "baseAmount": "<string>",
    "quoteAmount": "<string>",
    "rate": "<string>",
    "marketRate": "<string>",
    "chargedFee": "<string>",
    "cryptoChargedFee": "<string>",
    "deferredChargedFee": "<string>",
    "feeChargedInFiat": "<string>"
  },
  "paymentOrder": {
    "id": "<string>",
    "customerId": "<string>",
    "createdAt": "2023-11-07T05:31:56Z",
    "merchant": "<string>",
    "qrCode": "<string>",
    "amount": "<string>",
    "currency": "<string>",
    "providerTxnId": "<string>"
  },
  "amount": "10000.50",
  "cryptoAmount": "10.25",
  "paymentCurrency": "ARS",
  "depositCurrency": "USDC",
  "depositNetwork": "ETHEREUM",
  "depositAddress": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
  "cryptoDeposit": {
    "id": "<string>",
    "txnId": "<string>",
    "hash": "<string>",
    "currencyCode": "<string>",
    "addressDestination": "<string>",
    "confirmationDate": "2023-11-07T05:31:56Z",
    "amount": "<string>",
    "createdAt": "2023-11-07T05:31:56Z",
    "customerId": "<string>",
    "status": "<string>",
    "network": "<string>"
  },
  "status": "PENDING",
  "refundAddress": "<string>"
}

Authorizations

Authorization
string
header
required

Access token obtained via /oauth2/token/. Use as Authorization: Bearer <access_token>.

Body

application/json
customerId
string<uuid>
required

Unique identifier of the customer initiating the Sell and Pay transaction. Must be a valid customer registered in the system and associated with the account.

Example:

"b6cecc1f-c90d-424b-adaa-c82b780696c1"

externalRef
string
required

External reference identifier for tracking purposes. This can be used to correlate the transaction with external systems or partner records.

Maximum length: 250
Example:

"sp-12345-2024"

qrCode
string
required

QR code data containing the payment information for the merchant. This includes payment details such as recipient information and amount to be paid in fiat currency.

Minimum length: 1
Example:

"00020101021226360014BR.GOV.BCB.PIX0114+55119876543215204000053039865802BR5913Store Name XYZ6009SAO PAULO62070503***6304ABCD"

paymentCurrency
enum<string>
required

Fiat currency in which the payment will be made to the merchant. Must be one of the supported fiat currencies.

Available options:
ARS
Example:

"ARS"

depositCurrency
string

Cryptocurrency that will be deposited by the customer (e.g., BTC, ETH, USDC). If not specified, the system may use default settings or require it during execution.

Maximum length: 10
Example:

"USDC"

depositNetwork
string

Blockchain network for the cryptocurrency deposit (e.g., ETHEREUM, POLYGON, BITCOIN). Required when depositCurrency is provided. Must be a valid network supported for the specified deposit currency.

Maximum length: 128
Example:

"ETHEREUM"

refundAddress
string

Cryptocurrency address to which funds should be refunded if the transaction fails or is cancelled. Should be a valid address on the deposit network.

Maximum length: 255
Example:

"0x4e88BBeFF059BDDF5BF90ee0816E86eDf4214b32"

Response

Sell and Pay transaction successfully created

id
string

Unique identifier for the Sell and Pay transaction assigned by the B2B Service

Example:

"a3b2c1d0-1234-5678-90ab-cdef12345678"

createdAt
string<date-time>

Timestamp when the Sell and Pay transaction was created in ISO 8601 format

Example:

"2024-01-26T12:45:00.078230Z"

expiresAt
string<date-time>

Timestamp when the transaction will expire if not completed in ISO 8601 format. After expiration, cryptocurrency deposits will not be processed.

Example:

"2024-01-26T13:45:00.078230Z"

customerId
string<uuid>

Unique identifier of the customer who initiated the transaction

Example:

"b6cecc1f-c90d-424b-adaa-c82b780696c1"

trade
object

Trade execution details. This will be null until the trade is executed and contains information about the cryptocurrency-to-fiat conversion. Details of the cryptocurrency-to-fiat trade execution

paymentOrder
object

Payment order details for the merchant payment. Contains information about the QR code payment and merchant details. Details of the payment order to the merchant

amount
string

Payment amount in fiat currency to be paid to the merchant

Example:

"10000.50"

cryptoAmount
string

Amount of cryptocurrency required to complete the payment, calculated based on current exchange rates and fees

Example:

"10.25"

paymentCurrency
string

Fiat currency code for the payment (e.g., ARS, MXN, USD)

Example:

"ARS"

depositCurrency
string

Cryptocurrency code for the deposit (e.g., BTC, ETH, USDC)

Example:

"USDC"

depositNetwork
string

Blockchain network identifier for the cryptocurrency deposit (e.g., ETHEREUM, POLYGON, BITCOIN)

Example:

"ETHEREUM"

depositAddress
string

Cryptocurrency address where the customer should send the deposit. This is a unique address generated for this transaction.

Example:

"0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D"

cryptoDeposit
object

Information about the cryptocurrency deposit made by the customer. This will be null until a deposit is detected on the blockchain. Information about the cryptocurrency deposit received from the customer

status
enum<string>

Current status of the Sell and Pay transaction. INCOMPLETE: missing required fields. PENDING: ready to execute. WAITING_DEPOSIT: executed and ready to receive crypto deposit. RECEIVED_DEPOSIT: crypto deposit detected on blockchain. CONFIRMED_DEPOSIT: crypto deposit confirmed. TRADE_COMPLETED: cryptocurrency successfully converted to fiat. QR_EXECUTION_PENDING: preparing payment to merchant. COMPLETED: payment successfully made to merchant. CANCELED: transaction cancelled. REFUND_PENDING: refund being processed. REFUNDED: funds refunded to customer.

Available options:
INCOMPLETE,
PENDING,
WAITING_DEPOSIT,
RECEIVED_DEPOSIT,
CONFIRMED_DEPOSIT,
TRADE_COMPLETED,
QR_EXECUTION_PENDING,
COMPLETED,
CANCELED,
REFUND_PENDING,
REFUNDED
Example:

"PENDING"

refundAddress
string | null

Cryptocurrency address for refunds in case of transaction failure or cancellation