Referência API — Transações & Carteiras
URL base institucional:
https://api.afriswitch.net/api/v1/
1. PAYIN — Depósito
POST /transactions/payin/
Exemplo de pedido
{
"amount": 1000,
"currency": "GNF",
"operator": "mtn",
"country": "GN",
"phone_number": "224XXXXXX448",
"opaque_id": "teste_deposito_001"
}
Exemplo de resposta (valores mascarados)
{
"reference": "DP-AFS-GN-XXXX-2026XXXX-0004",
"opaque_id": "asw_trx_xxxxxxxxxxxx",
"transaction_type": "deposit",
"type": "fiat",
"status": "pending",
"amount": "1000.00",
"currency": "GNF",
"operator_name": "MTN Guiné",
"created_at": "2026-00-00T12:12:19Z",
"processed_at": null,
"payment_url": null,
"qr_code": null
}
Nota: O fluxo pode ser payment_url, OTP ou USSD dependendo do operador.
2. PAYOUT — Levantamento
POST /transactions/payout/
Exemplo de pedido
{
"amount": 200,
"currency": "XOF",
"operator": "orange-senegal",
"country": "SN",
"destination": "+221XXXX2235",
"metadata": { "nota": "Teste institucional de levantamento" }
}
Exemplo de resposta (valores mascarados)
{
"reference": "TX-2026XXXX-XXXXXX",
"opaque_id": "asw_trx_xxxxxxxxxxxx",
"transaction_type": "withdrawal",
"type": "fiat",
"status": "success",
"amount": "200.00",
"currency": "XOF",
"operator_name": "Orange Senegal",
"created_at": "2026-00-00T12:32:10Z",
"processed_at": "2026-00-00T12:32:13Z"
}
3. DETALHE — Detalhe da Transação
GET /transactions/detail/<reference>/
{
"reference": "TX-2026XXXX-XXXXXX",
"transaction_type": "withdrawal",
"status": "success",
"amount": "100.00",
"currency": "XOF",
"history": [
{
"status": "success",
"source": "operator",
"timestamp": "2026-00-00T12:32:13Z"
}
]
}
4. HISTÓRICO — Histórico da Transação
GET /transactions/history/<reference>/
{
"reference": "TX-2026XXXX-XXXXXX",
"transaction_type": "withdrawal",
"status": "success",
"amount": "100.00",
"currency": "XOF",
"history": [
{
"status": "success",
"source": "operator",
"timestamp": "2026-00-00T12:32:13Z"
}
]
}
5. ESTADO — Estado da Transação
GET /transactions/status/<reference>/
{
"reference": "TX-2026XXXX-XXXXXX",
"status": "success",
"amount": "100.00",
"currency": "XOF",
"transaction_type": "withdrawal",
"created_at": "2026-00-00T12:32:10Z",
"processed_at": "2026-00-00T12:32:13Z"
}
6. CARTEIRA — Saldo
GET /wallets/fiat/<currency>/
{
"wallet_reference": "WF-XXXXXXXXXXXX",
"balance": "4797.00",
"currency_code": "XOF",
"updated_at": "2026-00-00T21:45:42Z"
}
7. CARTEIRA — Movimentos
GET /wallets/fiat/<currency>/movements/
[
{
"movement_type": "withdrawal",
"amount": "507.50",
"fee_amount": "7.50",
"currency_code": "XOF",
"created_at": "2026-00-00T21:37:26Z"
}
]