Passer au contenu principal
POST
/
expire-pay
Expirer une Transaction de Paiement
curl --request POST \
  --url https://sandbox.fapshi.com/expire-pay \
  --header 'Content-Type: application/json' \
  --header 'apikey: <api-key>' \
  --header 'apiuser: <api-key>' \
  --data '
{
  "transId": "<string>"
}
'
const options = {
method: 'POST',
headers: {apiuser: '<api-key>', apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({transId: '<string>'})
};

fetch('https://sandbox.fapshi.com/expire-pay', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.fapshi.com/expire-pay",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'transId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>",
"apiuser: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import requests

url = "https://sandbox.fapshi.com/expire-pay"

payload = { "transId": "<string>" }
headers = {
"apiuser": "<api-key>",
"apikey": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
HttpResponse<String> response = Unirest.post("https://sandbox.fapshi.com/expire-pay")
.header("apiuser", "<api-key>")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"transId\": \"<string>\"\n}")
.asString();
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://sandbox.fapshi.com/expire-pay"

payload := strings.NewReader("{\n \"transId\": \"<string>\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("apiuser", "<api-key>")
req.Header.Add("apikey", "<api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
{
  "transId": "<string>",
  "serviceName": "<string>",
  "amount": 123,
  "revenue": 123,
  "payerName": "<string>",
  "email": "jsmith@example.com",
  "redirectUrl": "<string>",
  "externalId": "<string>",
  "userId": "<string>",
  "webhook": "<string>",
  "reason": "<string>",
  "financialTransId": "<string>",
  "dateInitiated": "2023-12-25",
  "dateConfirmed": "2023-12-25"
}
{
"message": "<string>"
}

Endpoint

POST /expire-pay Expire un lien de paiement pour empêcher tout paiement ultérieur.
Seules les transactions créées avec l’endpoint initiate-pay peuvent être expirées.

Paramètres

NomObligatoireTypeDescription
transIdOuichaîneID de la transaction à expirer

Réponse

  • Retourne les détails de la transaction expirée si l’opération réussit.
  • Retourne un 400 Bad Request avec le message "Link already expired" si la transaction était déjà expirée.

Autorisations

apiuser
string
header
requis
apikey
string
header
requis

Corps

application/json
transId
string
requis

Identifiant de la transaction à expirer.

Réponse

Lien de paiement expiré avec succès

transId
string

Identifiant de la transaction du paiement.

status
enum<string>

Statut de la transaction

Options disponibles:
CREATED,
PENDING,
SUCCESSFUL,
FAILED,
EXPIRED
medium
enum<string>

Méthode de paiement

Options disponibles:
mobile money,
orange money
serviceName
string

Nom du service utilisé

transType
enum<string>

Type de transaction

Options disponibles:
Collection,
Payout
amount
integer

Montant de la transaction

revenue
integer

Montant reçu après déduction des frais Fapshi

payerName
string

Nom du client

email
string<email>

Email du client

redirectUrl
string<uri>

URL de redirection après le paiement

externalId
string

Identifiant de la transaction sur votre application

userId
string

Identifiant du client sur votre application

webhook
string<uri>

Le webhook que vous avez défini pour votre service

reason
string

Apparaît généralement lorsqu'un retrait via fapshi échoue.

financialTransId
string

Identifiant de la transaction avec l'opérateur de paiement

dateInitiated
string<date>

Date à laquelle le paiement a été initié

dateConfirmed
string<date>

Date à laquelle le paiement a été effectué