Get started
Quickstart
Make your first test payout in four steps, with fake money.
1. Create credentials
Sign in to Tranzaq, open Developers, switch to Test, and choose New credentials. Give them a name and the scopes you need. Copy the client ID and the secret now: the secret is shown only once.
2. Get a token
Trade your client ID and secret for a token that lasts an hour.
Get a token · test
curl -X POST "https://api.tranzaq.com/oauth/token" \
-d grant_type=client_credentials \
-d client_id=tqz_test_1a2b3c4d \
-d client_secret=$CLIENT_SECRETconst response = await fetch("https://api.tranzaq.com/oauth/token", {
method: "POST",
body: new URLSearchParams({
grant_type: "client_credentials",
client_id: "tqz_test_1a2b3c4d",
client_secret: process.env.TRANZAQ_CLIENT_SECRET,
}),
});
const { access_token } = await response.json();using var http = new HttpClient { BaseAddress = new Uri("https://api.tranzaq.com") };
var response = await http.PostAsync("/oauth/token", new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = "tqz_test_1a2b3c4d",
["client_secret"] = Environment.GetEnvironmentVariable("TRANZAQ_CLIENT_SECRET")!,
}));
var token = (await response.Content.ReadFromJsonAsync<JsonElement>()).GetProperty("access_token").GetString();import os, requests
token = requests.post("https://api.tranzaq.com/oauth/token", data={
"grant_type": "client_credentials",
"client_id": "tqz_test_1a2b3c4d",
"client_secret": os.environ["TRANZAQ_CLIENT_SECRET"],
}).json()["access_token"]3. Add test money and a person
Test credentials can add fake money to the test balance. Then add the person you will pay; send a new Idempotency-Key for each different request.
Fund and add a person · test
curl -X POST "https://api.tranzaq.com/api/v1/sandbox/fund" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ "amount": 5000 }'
curl -X POST "https://api.tranzaq.com/api/v1/beneficiaries" \
-H "Authorization: Bearer $TOKEN" \
-H "Idempotency-Key: person-ama-0001" \
-H "Content-Type: application/json" \
-d '{ "name": "Ama Owusu", "destination": { "type": "MobileMoney", "accountNumber": "0241234567", "accountName": "Ama Owusu", "network": "MTN" } }'4. Create and submit a batch
Create and submit · test
curl -X POST "https://api.tranzaq.com/api/v1/payout-batches" \
-H "Authorization: Bearer $TOKEN" \
-H "Idempotency-Key: batch-oct-0001" \
-H "Content-Type: application/json" \
-d '{ "name": "October salaries", "items": [{ "beneficiaryId": "PERSON_ID", "amount": 100, "reference": "SAL-1" }] }'
curl -X POST "https://api.tranzaq.com/api/v1/payout-batches/BATCH_ID/submit" \
-H "Authorization: Bearer $TOKEN"In test mode no approver is needed, so the batch goes straight to the pretend bank. Fetch it with GET /api/v1/payout-batches/{id} and watch each payment move to Success.