Modifier, désactiver, supprimer
curl --request PATCH \
--url https://api.example.com/v1/payment-links/{id}import requests
url = "https://api.example.com/v1/payment-links/{id}"
response = requests.patch(url)
print(response.text)const options = {method: 'PATCH'};
fetch('https://api.example.com/v1/payment-links/{id}', 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.example.com/v1/payment-links/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/payment-links/{id}"
req, _ := http.NewRequest("PATCH", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.example.com/v1/payment-links/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/payment-links/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
response = http.request(request)
puts response.read_bodyLiens de paiement
Modifier, désactiver, supprimer
Modifier un lien de paiement, le désactiver ou le supprimer
PATCH
/
v1
/
payment-links
/
{id}
Modifier, désactiver, supprimer
curl --request PATCH \
--url https://api.example.com/v1/payment-links/{id}import requests
url = "https://api.example.com/v1/payment-links/{id}"
response = requests.patch(url)
print(response.text)const options = {method: 'PATCH'};
fetch('https://api.example.com/v1/payment-links/{id}', 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.example.com/v1/payment-links/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/payment-links/{id}"
req, _ := http.NewRequest("PATCH", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.example.com/v1/payment-links/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/payment-links/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
response = http.request(request)
puts response.read_bodyModifier un lien de paiement
Lire un lien par id
GET /v1/payment-links/by-id/{id}
GET /v1/payment-links/{slug} reste la lecture publique par slug.
Modifier
PATCH /v1/payment-links/{id}
| Paramètre | Type | Description |
|---|---|---|
name | string | Nom affiché au client |
description | string | Description |
is_active | boolean | Activer / désactiver |
min_amount / max_amount | integer | Bornes du montant libre (OPEN) |
success_redirect_url | string | URL de retour après paiement |
FIXED / OPEN) et le prix fixe ne se modifient pas : créez un nouveau lien.
curl -X PATCH https://api.sahelpay.ml/v1/payment-links/2f6c1e9a-... \
-H "Authorization: Bearer sk_test_xxx" \
-H "Content-Type: application/json" \
-d '{ "name": "Abonnement Premium (octobre)", "max_amount": 200000 }'
Désactiver / réactiver
PATCH /v1/payment-links/{id}/deactivate
PATCH /v1/payment-links/{id}/activate
Supprimer
DELETE /v1/payment-links/{id}
410.
SDKs
| Action | JS | PHP | Python |
|---|---|---|---|
| Lire par id | paymentLinks.retrieveById(id) | paymentLinks->retrieveById($id) | payment_links.retrieve_by_id(id) |
| Modifier | paymentLinks.update(id, {...}) | paymentLinks->update($id, [...]) | payment_links.update(id, **fields) |
| Supprimer | paymentLinks.delete(id) | paymentLinks->delete($id) | payment_links.delete(id) |