Aller au contenu principal

Liste des Retraits

Récupérer une liste paginée de vos retraits avec filtres optionnels.

Endpoint​

GET /api/v4/withdraw/list

Paramètres de requête​

ParamètreTypeDéfautDescription
pageInteger0Numéro de page (commence à 0)
sizeInteger20Éléments par page (max : 100)
statusString—Filtrer par statut (pending, success, failed...)

Exemples de requête​

Récupérer tous les retraits​

curl -X GET "https://pay.awdpay.pro/api/v4/withdraw/list?page=0&size=20" \
-H "Authorization: Bearer $AWDPAY_TOKEN"

Filtrer par statut​

curl -X GET "https://pay.awdpay.pro/api/v4/withdraw/list?page=0&size=20&status=success" \
-H "Authorization: Bearer $AWDPAY_TOKEN"

Pagination (page 2)​

curl -X GET "https://pay.awdpay.pro/api/v4/withdraw/list?page=1&size=20" \
-H "Authorization: Bearer $AWDPAY_TOKEN"

Réponse​

{
"content": [
{
"reference": "WTD1704067200000ABC123",
"status": "success",
"amount": 5000.00,
"currency": "XOF",
"beneficiaryName": "Amadou Diallo",
"beneficiaryPhone": "+221770123456",
"country": "SN",
"gatewayName": "wave-senegal",
"createdAt": "2025-01-15T10:30:00Z",
"processedAt": "2025-01-15T10:30:45Z"
},
{
"reference": "WTD1704063600000XYZ789",
"status": "pending",
"amount": 2500.00,
"currency": "XOF",
"beneficiaryName": "Fatou Sall",
"beneficiaryPhone": "+221770987654",
"country": "SN",
"gatewayName": "orange-money-sn",
"createdAt": "2025-01-15T09:00:00Z",
"processedAt": null
}
],
"pageable": {
"pageNumber": 0,
"pageSize": 20,
"offset": 0
},
"totalElements": 124,
"totalPages": 7,
"last": false,
"first": true,
"numberOfElements": 20,
"size": 20,
"number": 0,
"empty": false
}

Champs de réponse​

Contenu principal​

ChampTypeDescription
contentArrayListe des retraits sur cette page
totalElementsIntegerNombre total de retraits correspondant aux filtres
totalPagesIntegerNombre total de pages
sizeIntegerÉléments par page
numberIntegerNuméro de page actuelle
firstBooleanEst-ce la première page ?
lastBooleanEst-ce la dernière page ?
emptyBooleanLa liste est-elle vide ?

Objet retrait​

ChampTypeDescription
referenceStringRéférence unique du retrait
statusStringStatut actuel
amountDoubleMontant du retrait
currencyStringCode devise
beneficiaryNameStringNom du bénéficiaire
beneficiaryPhoneStringNuméro de téléphone
countryStringCode pays
gatewayNameStringPasserelle utilisée
createdAtDateTimeDate de création
processedAtDateTimeDate de traitement (si complété)

Filtrage par statut​

StatutDescription
pendingEn attente de traitement
processingEn cours de traitement
successComplété avec succès
failedÉchoué
expiredExpiré
cancelledAnnulé

Exemple de pagination​

async function fetchAllWithdrawals() {
let page = 0;
let allWithdrawals = [];
let hasMore = true;

while (hasMore) {
const response = await fetch(
`https://pay.awdpay.pro/api/v4/withdraw/list?page=${page}&size=100`,
{ headers: { 'Authorization': `Bearer ${token}` } }
);

const data = await response.json();
allWithdrawals = allWithdrawals.concat(data.content);

hasMore = !data.last;
page++;
}

return allWithdrawals;
}

Prochaine étape​

➡️ Statistiques — Accéder aux métriques agrégées