Quickstart
Make your first API call with a test key and the Sandbox Network. It takes less than 5 minutes.
In this guide you make a test key, connect the Sandbox Network, and read the first conversions. The Sandbox Network makes fake data. You need no network account and no credentials.
All requests use this base URL: https://api.afffast.com. Replace it with the URL of your API.
1. Make a test key
- Sign up in the dashboard and make a workspace.
- Switch the dashboard to test mode.
- Open API keys and select Make a key. Choose the scope
full, or a narrower scope. - Copy the key. The dashboard shows it one time. A test key starts with
sk_test_.
Only the owner of the workspace can make a key with the scope full. An admin can make keys with narrower scopes, for example read_only or sites:read. When an admin asks for the scope full, the API returns 403 with the code permission_denied. An admin also cannot rotate a key that has the scope full. A key with the scope full can export all data of the workspace.
Put the key in an environment variable:
export AFFFAST_API_KEY="sk_test_..."Send the key in the Authorization header of each request. Never put it in the URL. The API refuses a key in the query string (see api_key_in_query).
2. Check the key
curl https://api.afffast.com/v1/networks/sandbox \
-H "Authorization: Bearer $AFFFAST_API_KEY"The response is the object of the Sandbox Network. It shows availability: the network works in test mode only. If you get a 401 error, the key is not correct. See api_key_invalid.
3. Connect the Sandbox Network
The field seed is any text. The same seed always gives the same data.
curl -X POST https://api.afffast.com/v1/connections \
-H "Authorization: Bearer $AFFFAST_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"network": "sandbox",
"label": "My sandbox",
"credentials": { "seed": "my-test-seed" }
}'The response has the id of the connection (conn_...). The API starts the first sync and the load of the history at once. Read the progress:
curl https://api.afffast.com/v1/connections/conn_.../setup \
-H "Authorization: Bearer $AFFFAST_API_KEY"The Sandbox Network has two sites and about 30 conversions each day for the first site. The first conversions are there in about a minute.
4. Read the conversions
curl "https://api.afffast.com/v1/conversions?limit=3" \
-H "Authorization: Bearer $AFFFAST_API_KEY"The response is a list. This is a short example:
{
"object": "list",
"url": "/v1/conversions",
"has_more": true,
"data": [
{
"id": "conv_...",
"object": "conversion",
"livemode": false,
"status": "pending",
"sold_at": "2026-11-21T14:03:10Z",
"amounts": {
"source": { "currency": "DKK", "order_amount": "499.0000", "commission": "49.9000" },
"workspace": { "currency": "EUR", "order_amount": "66.9000", "commission": "6.6900" }
}
}
]
}livemode is false: this is test data. Use starting_after to get the next page. See Pagination.
5. Read the totals
GET /v1/stats needs a date range. Use group_by to get rows.
curl -g "https://api.afffast.com/v1/stats?date[gte]=2026-11-01&date[lte]=2026-11-30&group_by=network" \
-H "Authorization: Bearer $AFFFAST_API_KEY"Next steps
- Receive webhooks. Get an event for each new conversion.
- Track clicks. Make a link and see which page earned a commission.
- Test mode. Make test conversions and change their status.
- Connect a real network.
- The API reference has code samples in curl, Node.js, Python and PHP for each operation.