curl --request POST \
--url https://sandbox-b2b.ripio.com/api/v1/opt-in/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"end_user_id": "75c741a2-c3c8-46b1-a807-4fa1f40bf048"
}
'[
{
"id": "c468be09-3a1f-41aa-ad08-c7d715957105",
"transaction_id": "e826023d-fddc-4ce1-bdac-7506ed17eb0e",
"end_user_id": "75c741a2-c3c8-46b1-a807-4fa1f40bf048",
"asset": "BTC",
"created_at": "2025-04-10T15:53:11.847992Z",
"opt_out_at": null,
"is_active": true
},
{
"id": "c468be09-3a1f-41aa-ad08-c7d715957106",
"transaction_id": "e826023d-fddc-4ce1-bdac-7506ed17eb01",
"end_user_id": "75c741a2-c3c8-46b1-a807-4fa1f40bf048",
"asset": "ETH",
"created_at": "2025-04-10T15:53:11.847993Z",
"opt_out_at": null,
"is_active": true
}
]Yield Opt In
Register a user to participate in the yield-earning program. This enables daily interest accrual on supported assets held by the user. By default the user is opted into every product enabled for your account, and that form of the request requires the user to have no active opt-in at all. Send the optional asset field to opt into a single product instead, one request per product, leaving the other opts of the user untouched. Opt-in applies to the full balance of each opted-in asset.
curl --request POST \
--url https://sandbox-b2b.ripio.com/api/v1/opt-in/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"end_user_id": "75c741a2-c3c8-46b1-a807-4fa1f40bf048"
}
'[
{
"id": "c468be09-3a1f-41aa-ad08-c7d715957105",
"transaction_id": "e826023d-fddc-4ce1-bdac-7506ed17eb0e",
"end_user_id": "75c741a2-c3c8-46b1-a807-4fa1f40bf048",
"asset": "BTC",
"created_at": "2025-04-10T15:53:11.847992Z",
"opt_out_at": null,
"is_active": true
},
{
"id": "c468be09-3a1f-41aa-ad08-c7d715957106",
"transaction_id": "e826023d-fddc-4ce1-bdac-7506ed17eb01",
"end_user_id": "75c741a2-c3c8-46b1-a807-4fa1f40bf048",
"asset": "ETH",
"created_at": "2025-04-10T15:53:11.847993Z",
"opt_out_at": null,
"is_active": true
}
]asset therefore
returns a list of a single element.
Opt in to every enabled product or Opt in to a single product — to see a
request paired with the response it actually produces.Opt in to every enabled product
Omitasset. Every product enabled for your account is opted into, and one opt-in comes back per
product. This form requires the user to have no active opt-in at all.
asset is not a top-up. It does not add the products a user is missing: if the user
already has an active opt-in — even for a single product — the request fails with 400 and
nothing changes.A user opted into USDT only, on an account where BTC, ETH and USDT are enabled:{
"end_user_id": "75c741a2-c3c8-46b1-a807-4fa1f40bf048"
}
{
"code": 20000,
"type": "ValidationError",
"detail": {
"non_field_errors": [
{
"message": "An active OptIn already exists for user 75c741a2-c3c8-46b1-a807-4fa1f40bf048",
"code": "invalid"
}
]
},
"status": 400
}
USDT alone. To add BTC and ETH, send one request per product
with asset, as shown below.{
"end_user_id": "75c741a2-c3c8-46b1-a807-4fa1f40bf048"
}
[
{
"id": "c468be09-3a1f-41aa-ad08-c7d715957105",
"transaction_id": "e826023d-fddc-4ce1-bdac-7506ed17eb0e",
"end_user_id": "75c741a2-c3c8-46b1-a807-4fa1f40bf048",
"asset": "BTC",
"created_at": "2025-04-10T15:53:11.847992Z",
"opt_out_at": null,
"is_active": true
},
{
"id": "c468be09-3a1f-41aa-ad08-c7d715957106",
"transaction_id": "e826023d-fddc-4ce1-bdac-7506ed17eb01",
"end_user_id": "75c741a2-c3c8-46b1-a807-4fa1f40bf048",
"asset": "ETH",
"created_at": "2025-04-10T15:53:11.847993Z",
"opt_out_at": null,
"is_active": true
}
]
Opt in to a single product
Sendasset. Only that product is opted into, and the other opts of the user are left as they
are. Send one request per product you want to enable.
This is also the only way to enable a further product for a user who is already opted into
something: one request per product to add, each naming its asset.
{
"end_user_id": "75c741a2-c3c8-46b1-a807-4fa1f40bf048",
"asset": "USDT"
}
[
{
"id": "c468be09-3a1f-41aa-ad08-c7d715957107",
"transaction_id": "e826023d-fddc-4ce1-bdac-7506ed17eb02",
"end_user_id": "75c741a2-c3c8-46b1-a807-4fa1f40bf048",
"asset": "USDT",
"created_at": "2025-04-10T15:53:11.847994Z",
"opt_out_at": null,
"is_active": true
}
]
Authorizations
B2B’s White Label API uses OAuth2. Currently there is only one supported authentication flow:
- clientCredentials allows you to access your own B2B account (First-Party Integration) and performs transactions against the public API. This oauth2 flow is well suited for this API, as it allows machine-to-machine communication.
Every call to the API has to be authenticated with an OAuth2 Token. In order to request this token, you will need to have sandbox or production API Keys (client id and client secret) that will be needed to generate a credential in order to negotiate an ephemeral access token.
Every request must be accompianed by an Authorization header with a value that follows the following schema: Bearer ACCESS_TOKEN
Body
End user's external ref.
Optional. Symbol of the single product to opt the end user into, for example USDT. Only the products enabled for your account are accepted; the Yield APYs endpoint lists them. Send one request per product: each one either succeeds for that product or fails without touching the other opts of the end user. When omitted, the end user is opted into every product enabled for your account, and the request requires the end user to have no active opt-in at all: omitting asset is not a top-up, so if the end user already has one — even for a single product — the request fails and nothing changes. To add products to an end user who already has some, send one request per product with asset.
Response
Successful Creation
UUID used as opt in identifier.
UUID used as opt in's transaction identifier.
Unique identifier used as end user's external ref.
Asset symbol.
ISO format creation datetime
ISO format opt out datetime
Indicates if the opt in is active.
Was this page helpful?