If you’ve already authenticated and have USD and USDG balances in a Profile, skip ahead to the request a conversion step.
➊ Authenticate
Include the following scopes when authenticating:If you don’t see all the scopes when creating or editing API credentials, contact Support.
➋ Deposit USD and USDG
Use Create Sandbox Deposit to add USD to the Profile (profile_id) you want the conversion to be associated with. See the First API Request guide for help retrieving Profile IDs.
This guide also includes examples for the USDG → USD conversion, so if you are following along make sure you add some USDG to the Profile.
You can also use the Fiat Transfers funding flow if you’ve already set up a Fiat Account.
USD
USDG
➌ Request Conversion
Request a conversion using Create Stablecoin Conversion. Include the following body parameters in your request to convert thesource_asset of $100 USD into the target_asset.
For Third-party integrations, you must also specify identity_id and account_id.
USDG → USD
id, which can be used to lookup the transaction, and the status will always be CREATED.
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”`.
USD → PYUSD
id, which can be used to lookup the transaction, and the status will always be CREATED.
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”`.
➍ Confirm the Conversion
Use List Stablecoin Conversions to check the conversion status. The request requires theprofile_id query parameter.
settled_at parameter and the status is SETTLED for all conversions executed for the given Profile.
Stablecoin Conversion Asset Precision
You can convert USD to any supported asset and vice versa. However, you cannot convert one stablecoin to another. All conversions use the lowest maximum precision among the asset pairs.Stablecoin Conversion Statuses
There are three conversion statuses:CREATED: The conversion has been submitted successfully but has not yet settled.SETTLED: The conversion has been completed.CANCELLED: The conversion was stopped using the cancel endpoint for the pending conversion.
CREATED status, the source_asset (for example, fiat for acquiring stablecoin) will be debited from the profile_id balance.
The target_asset (for example, USDG for acquiring stablecoin) will not be credited until the order has SETTLED.