Skip to main content
Version: 1.0.0%20%280.1.11%29

Transfa Payment Documentation

Introduction

This is the official documentation for the Transfa Payment REST API. Transfa is a payment aggregator helping you collect payments from your consumers. The API is built following REST conventions and also supports webhook events.

The usage of the API requires an API Key. This API key can be retrieved from the dashboard in the settings section. Feel free to create your account now, it's free and you don't need verifications to start collecting funds!😎

Here are the actions you can do for the moment:

The team behind Transfa has also developed and created SDKs and plugins you can use for a smoother integration.

In the next versions, we will have Shopify and WooCommerce plugins.

Happy Coding!🚀

Authentication

The Transfa API uses API key authentication for most of the endpoints except the API status endpoint. The API Key is passed in the Authorization header with the following format Authorization: YOUR_API_KEY. Here's an example of a request written in Python. The following request creates a payment of type request-payment.

import requests

url = "https://api.transfapp.com/api/v1/optimus/payment/"

payload = {
"account_alias": "67101010",
"type": "request-payment",
"amount": 1200,
"mode": "mtn-benin",
"webhook_url": "https://ptsv2.com/t/xw7zq-16s57325355/post"
}
headers = {
"Content-Type": "application/json",
"Idempotency-Key": "433753a7ae9d44f4b95903bbe813553a",
"Authorization": "ak_test:gAAAAABjEdslstkCdDE7ubYtwuq96ugXdyXmSC8Am3HMi2MWnGrg4iAOe3g8aqaud8PzrLExxejfqLsalcB_jApiXs_9-Kt_3EC9hMZ9zW0AJ3bhTzsw0-BQF4bYcIdqcTfJHlNDU5qk"
}

response = requests.request("POST", url, json=payload, headers=headers)

print(response.text)

Types of API Keys

There are two types of API keys: Testing API Keys and Production API Keys.

A Testing API key starts with the prefix ak_test coming with a private key with a prefix ps_test. The private key is used to sign data send/received via the webhooks.

For the production keys, the API key starts with the ak_live prefix and the private key with the ps_live prefix.

Note : The API keys are generated and directly shown to you when you create them. We do not store the keys following our security guidelines. Make sure to keep them safe for usage. In case of leaking, you can freely revoke the API keys on the dashboard.

Security Scheme Type:apiKey
Header parameter name:Authorization