Prerequisites
Before you begin this quickstart, ensure that you have:- Obtained an API key for Mint from Circle
- Obtained access to the Crypto Payouts API
- Installed cURL on your development machine
- (Optional) configured a webhook notification endpoint
Part 1: Create an active recipient
Before sending a payout, you must first create a recipient your Mint address book. Depending on your Mint configuration, new recipients may either be active immediately or inactive for the first 24 hours.Note: You have the option to turn on delayed withdrawals in the Circle
Mint console. When turned on, all new addresses are inactive for the first 24
hours, during which you can’t make a payout. When turned off, all new
addresses are available for payouts immediately.
1.1. Add a recipient to your address book
The/v1/addressBook/recipients
endpoint creates a new recipient address in your Mint address book. Use the
following example request to create a new recipient.
Shell
JSON
1.2. Check recipient status
Prior to sending the payout you must ensure the recipient is active. You can’t send a payout to an inactive recipient. You can check if the recipient is active through the API in two ways: webhook notifications or polling the endpoint. If you have turned on delayed withdrawals, you should set up one of these methods to check when the new recipient changes status frominactive to
active. If you have turned off inactive withdrawals, you should use the
polling example to verify that the recipient is in the active
state on creation.
You should not continue this guide until you’ve verified the new recipient is in
the active state.
1.2.1. Webhook notifications (optional)
Webhook notifications allow you to receive updates from Mint on events on your account. If configured, you’ll receive updates when address book recipients are created or change status. An example notification showing the recipient status change is shown below.JSON
1.2.2. Polling
If you don’t have webhook notifications set up, or you have delayed withdrawals turned off, you can poll the/v1/addressBook/recipients/{id}
endpoint until the response contains the "status": "active" parameter.
Polling consists of calling the endpoint on a regular interval until the desired
response is returned. The following example is a manual request to the endpoint:
Shell
JSON
Part 2: Create a payout
Once you have successfully created a recipient, create a payout using the/v1/payouts endpoint. The
request should include the recipient address ID, originating funds, and the
currency the recipient would like to receive.
Use the following command to create a payout:
Shell
JSON
Part 3: Check payout status
As a best practice, you should always check that the funds were sent and delivered onchain.3.1. Webhook notifications (optional)
If you have configured webhook notifications you’ll receive a notification for each payout status update. The following is an example notification:JSON
3.2: Polling (optional)
If you don’t have webhook notifications set up you can poll the/v1/payouts/{id} endpoint
until the response contains the "status": "complete" parameter.
Polling consists of calling the endpoint on a regular interval until the desired
response is returned. The following example is a manual request to the endpoint:
Shell
JSON