Relancer un paiement échoué
curl --request POST \
--url https://api.saspay.me/api/v1/payments/{payment_id}/retry/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"methods": [
"moov_bj"
]
}
'import requests
url = "https://api.saspay.me/api/v1/payments/{payment_id}/retry/"
payload = { "methods": ["moov_bj"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({methods: ['moov_bj']})
};
fetch('https://api.saspay.me/api/v1/payments/{payment_id}/retry/', 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://api.saspay.me/api/v1/payments/{payment_id}/retry/",
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([
'methods' => [
'moov_bj'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.saspay.me/api/v1/payments/{payment_id}/retry/"
payload := strings.NewReader("{\n \"methods\": [\n \"moov_bj\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.post("https://api.saspay.me/api/v1/payments/{payment_id}/retry/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"methods\": [\n \"moov_bj\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.saspay.me/api/v1/payments/{payment_id}/retry/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"methods\": [\n \"moov_bj\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "Payment retried successfully",
"id": "9c3f2a10-4b7e-4f1a-9d2e-9b6a7c1e4a02",
"checkout_url": ""
}{
"message": "Seuls les paiements (INBOUND) sont réessayables via cet endpoint.",
"code": "invalid_flow"
}{
"message": "Transaction introuvable.",
"code": "not_found"
}{
"message": "Transaction déjà 'SUCCESS', non réessayable.",
"code": "not_retryable"
}{
"message": "Réseau inconnu ou inactif : 'moov_xx'.",
"code": "invalid_method"
}Paiements
Relancer un paiement échoué
Rejoue le routage sur la même transaction, sans en créer une nouvelle
POST
/
payments
/
{payment_id}
/
retry
/
Relancer un paiement échoué
curl --request POST \
--url https://api.saspay.me/api/v1/payments/{payment_id}/retry/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"methods": [
"moov_bj"
]
}
'import requests
url = "https://api.saspay.me/api/v1/payments/{payment_id}/retry/"
payload = { "methods": ["moov_bj"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({methods: ['moov_bj']})
};
fetch('https://api.saspay.me/api/v1/payments/{payment_id}/retry/', 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://api.saspay.me/api/v1/payments/{payment_id}/retry/",
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([
'methods' => [
'moov_bj'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.saspay.me/api/v1/payments/{payment_id}/retry/"
payload := strings.NewReader("{\n \"methods\": [\n \"moov_bj\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.post("https://api.saspay.me/api/v1/payments/{payment_id}/retry/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"methods\": [\n \"moov_bj\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.saspay.me/api/v1/payments/{payment_id}/retry/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"methods\": [\n \"moov_bj\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "Payment retried successfully",
"id": "9c3f2a10-4b7e-4f1a-9d2e-9b6a7c1e4a02",
"checkout_url": ""
}{
"message": "Seuls les paiements (INBOUND) sont réessayables via cet endpoint.",
"code": "invalid_flow"
}{
"message": "Transaction introuvable.",
"code": "not_found"
}{
"message": "Transaction déjà 'SUCCESS', non réessayable.",
"code": "not_retryable"
}{
"message": "Réseau inconnu ou inactif : 'moov_xx'.",
"code": "invalid_method"
}Réutilise le même
id de transaction — aucune nouvelle transaction n’est créée. Réservé aux paiements entrants (flow_direction: "INBOUND") ; un payout renvoie 400 invalid_flow.Authorizations
Clé API secrète du marchand — header Authorization: Bearer sk_live_xxx (ou sk_test_xxx en environnement de test).
Path Parameters
Body
application/json
Response
Paiement relancé (même id de transaction)
⌘I