curl --request POST \
--url https://api.dinari.me/api/v1/payments/{id}/refund \
--header 'Content-Type: application/json' \
--data '
{
"amount": "1000.00"
}
'import requests
url = "https://api.dinari.me/api/v1/payments/{id}/refund"
payload = { "amount": "1000.00" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({amount: '1000.00'})
};
fetch('https://api.dinari.me/api/v1/payments/{id}/refund', 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.dinari.me/api/v1/payments/{id}/refund",
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([
'amount' => '1000.00'
]),
CURLOPT_HTTPHEADER => [
"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.dinari.me/api/v1/payments/{id}/refund"
payload := strings.NewReader("{\n \"amount\": \"1000.00\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.dinari.me/api/v1/payments/{id}/refund")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"1000.00\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dinari.me/api/v1/payments/{id}/refund")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": \"1000.00\"\n}"
response = http.request(request)
puts response.read_body{
"amount": "1500.00",
"business_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"currency": "<string>",
"fail_url": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"language": "<string>",
"satim_order_number": "<string>",
"status": "PENDING",
"success_url": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"action_code": "<string>",
"action_code_description": "<string>",
"approval_code": "<string>",
"card_brand": "<string>",
"customer_email": "<string>",
"customer_name": "<string>",
"customer_phone": "<string>",
"description": "<string>",
"form_url": "<string>",
"masked_pan": "<string>",
"order_ref": "<string>",
"paid_at": "2023-11-07T05:31:56Z",
"payment_link_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resp_code": "<string>",
"resp_code_desc": "<string>",
"satim_error_code": "<string>",
"satim_order_id": "<string>",
"satim_order_status": 123
}Refund a Payment
Refund a PAID payment via Satim (full by default, or a partial amount once the payment has settled). The refund is debited from your DINARI balance before Satim is asked, so it is refused (409) when the money has already been paid out. Marks the payment REFUNDED and fires a PAYMENT_REFUNDED webhook.
curl --request POST \
--url https://api.dinari.me/api/v1/payments/{id}/refund \
--header 'Content-Type: application/json' \
--data '
{
"amount": "1000.00"
}
'import requests
url = "https://api.dinari.me/api/v1/payments/{id}/refund"
payload = { "amount": "1000.00" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({amount: '1000.00'})
};
fetch('https://api.dinari.me/api/v1/payments/{id}/refund', 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.dinari.me/api/v1/payments/{id}/refund",
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([
'amount' => '1000.00'
]),
CURLOPT_HTTPHEADER => [
"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.dinari.me/api/v1/payments/{id}/refund"
payload := strings.NewReader("{\n \"amount\": \"1000.00\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.dinari.me/api/v1/payments/{id}/refund")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"1000.00\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dinari.me/api/v1/payments/{id}/refund")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": \"1000.00\"\n}"
response = http.request(request)
puts response.read_body{
"amount": "1500.00",
"business_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"currency": "<string>",
"fail_url": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"language": "<string>",
"satim_order_number": "<string>",
"status": "PENDING",
"success_url": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"action_code": "<string>",
"action_code_description": "<string>",
"approval_code": "<string>",
"card_brand": "<string>",
"customer_email": "<string>",
"customer_name": "<string>",
"customer_phone": "<string>",
"description": "<string>",
"form_url": "<string>",
"masked_pan": "<string>",
"order_ref": "<string>",
"paid_at": "2023-11-07T05:31:56Z",
"payment_link_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resp_code": "<string>",
"resp_code_desc": "<string>",
"satim_error_code": "<string>",
"satim_order_id": "<string>",
"satim_order_status": 123
}Path Parameters
Payment UUID
Body
Optional body for a refund. Omit or {} for a full refund.
Partial refund amount in DZD. Defaults to the full payment amount.
"1000.00"
Response
Refund accepted; payment marked REFUNDED
"1500.00"
Lifecycle status of a payment.
PENDING, PAID, FAILED, REFUSED, CANCELED, REFUNDED, EXPIRED Authorization number from the SATIM authorization server.
Card network used: "CIB" or "EDAHABIA".
Captured on the hosted link page, when the link asks for them. Never populated for API-created payments — those carry the customer's details on the merchant's side.
Set when this payment was started from a payment link rather than by an
API call. None for every payment a merchant's own server created.
Issuer response code (respCode); "00" when accepted.
Human-readable respCode description — the SATIM IHM return page's
primary message for both accepted and rejected payments.