Skip to main content

Quickstart

Easily convert USD to USDP in the Sandbox environment.

The workflow for converting USD to USDP can be used for any of the supported asset pairs:

tip

Paxos must enable access to the Conversion API in your Sandbox Account before you can add the scopes to a client. Contact support or your Paxos Representative for details.

1. Authenticate

Add the conversion:read_conversion_stablecoin and conversion:write_conversion_stablecoin scopes to your Sandbox Account under the API Management setting.

Authenticate in Sandbox using the scopes. You may also need to add the funding:read_profile scope to enable funding and fetch a Profile ID to complete a conversion.

curl https://oauth.sandbox.paxos.com/oauth2/token \
-F grant_type=client_credentials \
-F client_id={paxos_clientid} \
-F client_secret={paxos_secret} \
-F scope="conversion:read_conversion_stablecoin conversion:write_conversion_stablecoin funding:read_profile"

2. Sandbox Funding

Use Create Sandbox Deposit to fund your Sandbox Account if not already done so. Specify the Sandbox Profile (profile_id) you want the conversion to be associated with.

curl --request POST \
--location 'https://api.sandbox.paxos.com/v2/sandbox/profiles/{profile_id}/deposit' \
--header 'Authorization: Bearer {access_token}' \
--data '{
"asset": "USD",
"amount": "1000"
}'

3. Create a Stablecoin Conversion

Request a conversion using Create Stablecoin Conversion. Include the following body parameters in your request to convert the source_asset of $100 USD into the target_asset of 100 USDP.

note

For Third-party integrations, you must also specify identity_id and account_id.

curl --location 'https://api.sandbox.paxos.com/v2/conversion/stablecoins' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {access_token}' \
--data '{
"ref_id": "my_custom_ref_id_1",
"profile_id": "{profile_id}",
"amount": "100",
"source_asset": "USD",
"target_asset": "USDP",
}'

The StablecoinConversion object returns with "status": "CREATED", signifying the conversion request has been received but not yet completed. When a conversion is in CREATED status, the source_asset is immediately debited from the associated profile_id balance. The target_asset will not be credited until the conversion status is "status": "SETTLED".

Values for identity_id and account_id default to 00000000-0000-0000-0000-000000000000 when the fields are not part of the request.

{
"id": "f190b163-208f-4d73-8deb-4fb8b24add00",
"profile_id": "{profile_id}",
"amount": "100",
"source_asset": "USD",
"target_asset": "USDP",
"status": "CREATED",
"ref_id": "my_custom_ref_id_1",
"identity_id": "00000000-0000-0000-0000-000000000000",
"account_id": "00000000-0000-0000-0000-000000000000",
"created_at": "2023-10-02T23:13:10.716623354Z",
"updated_at": "2023-10-02T23:13:10.899Z"
}

4. Monitor Conversion Status

To retrieve the conversion status, use either Get Stablecoin Conversion or List Stablecoin Conversions.

Use the StablecoinConversion object id as a path parameter to retrieve a single conversion.

curl --location 'https://api.sandbox.paxos.com/v2/conversion/stablecoins/f190b163-208f-4d73-8deb-4fb8b24add00' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {access_token}'

The returned StablecoinConversion object is similar to the Create Stablecoin Conversion response, except it includes an additional settled_at parameter and the status value changes to SETTLED upon completion.

{
"id": "f190b163-208f-4d73-8deb-4fb8b24add00",
"profile_id": "{profile_id}",
"amount": "100",
"source_asset": "USD",
"target_asset": "USDP",
"status": "SETTLED",
"ref_id": "my_custom_ref_id_1",
"identity_id": "00000000-0000-0000-0000-000000000000",
"account_id": "00000000-0000-0000-0000-000000000000",
"created_at": "2023-10-02T23:13:10.716623Z",
"updated_at": "2023-10-02T23:13:10.899Z",
"settled_at": "2023-10-02T23:13:11.241690Z"
}

Next Steps

✉️ Question? Contact us:
Crypto Brokerage Support | Commodities Settlement Support | Help Desk

📃 Check out our Changelog.