source_profile_id) and Target Profile (target_profile_id).
The Profiles are under the same Sandbox Account for simplicity and to allow completion of the steps with a single authentication.
This guild also funds the Source Profile with BTC and ETH for the DELIVER leg and USD in the Target Profile for the RECEIVE leg before creating the transaction request.
Contact your Entity Manager or Support if you run into any issues or don’t have access to a Sandbox Account.
1. Authenticate
Add thesettlement:read_transaction and settlement:write_transaction scopes to your Sandbox Account under the API Management setting and then authenticate in Sandbox using the scopes.
Also include funding:read_profile and funding:write_profile for creating and funding Profiles.
access_token to use in the request authorization header throughout this guide.
2. Set Up Profiles
Create two new Profiles in the Sandbox Account, one withSource Profile and the second with Target Profile as the nickname.
Create Source Profile
id from the response to fund the Profile and propose a transaction.
Create Target Profile
id from the response to fund the Profile and propose a transaction.
3. Fund Profiles
Next, use Create Sandbox Deposit to fund the Profiles.This guide pre-funds all accounts prior to creating a settlement request for simplicity.
However, it is possible to create and approve a settlement request before the funds are available.
Fund Source Profile
Deposit crypto into the Source Profile. First, Bitcoin:assets query parameter to filter out all other assets.
Fund Target Profile
Deposit USD into the Target Profile.4. Propose Transaction
Using the Source Profile and Target Profileprofile_id created earlier, use Create Transaction to propose exchanging 1 BTC and 5 ETH (in the Source Profile balance) for $50,000 USD (in the Target Profile balance). The ref_id must be unique. The settlement window defaults apply if settlement_window_start and/or settlement_window_end are not specified.
Transaction object.
The unique transaction id is used to approve and retrieve the transaction, and the Source Profile owner can use the id to cancel the PENDING transaction.
The transaction status can be used by either party to retrieve a list of filtered transactions.
5. Approve Transaction
The Target Profile owner approves (affirms) the transaction.Since the same Paxos Account is used for both counterparty Profiles in this guide, you can use the same authentication.
Transaction.id from the propose step as the transaction_id.
You can also look up a transaction by status to find the id.
AFFIRMED status and updated_at timestamp.
6. Check Transaction Status
Settlement of theAFFIRMED transaction occurs only when both counterparties fully fund their Profiles.
Since both Profiles in this guide are pre-funded, the transaction settled within a few seconds.
Transaction object.
When the transaction completes, the status and updated_at timestamp reflect the most recent activity.
Next Steps
- Create a settlement transaction before funding the Profiles.
- Learn more in the Settlements FAQ.
- Explore settlement methods and objects in the Settlements API.