Authentication & Headers

The three headers every request needs.

Every request carries three headers. There is nothing else to set up.

HeaderValueIf it is wrong
AuthorizationBasic followed by the Base64 encoding of username:password401. Check the encoding, and that the credentials belong to this environment
MIDYour merchant ID401
Content-Typeapplication/json, on any request with a body400

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.