Prerequisites
- A workspace API key, exported as
RANGE_API_KEY. Use the shared quickstart for key setup and Bearer authentication. - Permission to create synthetic records in the workspace selected by your key.
1. Look for existing names
Run this setup once to create the API client and generate a unique name and synthetic address, following the Platform test inputs. It useshttpx.
GET /v2/counterparties.
search matches a case-insensitive substring of the name. Review candidates before creating a record. This lookup does not reserve a name or prevent duplicates; creation separately enforces workspace name uniqueness. A null meta.next_cursor ends pagination.
2. Create the counterparty
Create the counterparty with the generated name usingPOST /v2/counterparties.
id as counterparty_id for every subsequent request. Use the IDs returned by your own requests throughout this guide.
Creating the same name again returns HTTP 409, as the example request body and error response below show. You do not need to send a duplicate, and the complete script does not.
3. Add an address
Attach the synthetic address from step 1 on theethereum network using PUT /v2/counterparties/{id}/addresses.
4. Read back the address
Read the saved counterparty usingGET /v2/counterparties/{id} and check for the address you just added.
5. Optionally add a synthetic bank record
Add a synthetic CAD bank record usingPUT /v2/counterparties/{id}/bank-accounts.
Use only fake bank and account names without bank identifiers.
6. Read back the bank record
Read the counterparty again usingGET /v2/counterparties/{id} and check for the saved CAD bank record.
Prepare a sample document
Before step 7, define a helper that builds a tiny generated PDF in memory:7. Optionally upload the document
Upload the generated PDF usingPOST /v2/counterparties/{id}/documents to attach it to the counterparty.
Uploads accept PDF, CSV or plain text up to 10 MB; the upload
type accepts kyc, kyb, contract, other, narrative, or statement.8. Read back the document metadata
Read the counterparty usingGET /v2/counterparties/{id} and check for the uploaded document’s ID and MIME type.
Complete runnable script
Save asonboard_counterparty.py. Set RANGE_API_KEY as in the shared quickstart, then run python onboard_counterparty.py; add --with-bank --with-document to exercise both optional branches. The script verifies the synthetic data, then removes its own children and counterparty. The step-by-step requests above keep the record until you delete it.