The three headers every request needs.
Every request carries three headers. There is nothing else to set up.
| Header | Value | If it is wrong |
|---|---|---|
Authorization | Basic followed by the Base64 encoding of username:password | 401. Check the encoding, and that the credentials belong to this environment |
MID | Your merchant ID | 401 |
Content-Type | application/json, on any request with a body | 400 |
Where to find your credentials
In the dashboard, open Settings → Integration. It shows your username, your MID, and a regenerate button for the password. The password is shown once, when you regenerate it. Sandbox and production have separate credentials.
Check they work
curl 'https://sandbox-api.transfi.com/v3/config/list-mids' \
-u "$TRANSFI_USERNAME:$TRANSFI_PASSWORD" \
-H "MID: $TRANSFI_MID"If the call returns your MIDs, you are authenticated.
More than one MID
Balances, orders and settings are scoped to the MID you send. On Get Balance you can omit the header to get the total across all your merchants.
Never put credentials in frontend code, mobile apps or public repositories.