curl --request POST \
--url https://sandbox-api.luminpay.co/charges/{chargeId}/refunds \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": "<string>",
"pin": "<string>",
"expectedSendAmount": "<string>"
}
'import requests
url = "https://sandbox-api.luminpay.co/charges/{chargeId}/refunds"
payload = {
"amount": "<string>",
"pin": "<string>",
"expectedSendAmount": "<string>"
}
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({amount: '<string>', pin: '<string>', expectedSendAmount: '<string>'})
};
fetch('https://sandbox-api.luminpay.co/charges/{chargeId}/refunds', 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-api.luminpay.co/charges/{chargeId}/refunds",
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' => '<string>',
'pin' => '<string>',
'expectedSendAmount' => '<string>'
]),
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://sandbox-api.luminpay.co/charges/{chargeId}/refunds"
payload := strings.NewReader("{\n \"amount\": \"<string>\",\n \"pin\": \"<string>\",\n \"expectedSendAmount\": \"<string>\"\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://sandbox-api.luminpay.co/charges/{chargeId}/refunds")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"<string>\",\n \"pin\": \"<string>\",\n \"expectedSendAmount\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.luminpay.co/charges/{chargeId}/refunds")
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 \"amount\": \"<string>\",\n \"pin\": \"<string>\",\n \"expectedSendAmount\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"refundId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"chargeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": "<string>",
"sendAmount": "<string>",
"asset": "<string>",
"destinationAddress": "<string>",
"status": "pending",
"merchantApprovalStatus": "not_required",
"scheduledFor": "2023-11-07T05:31:56Z",
"rateBasis": "original",
"moveBps": 123,
"merchantDebitKobo": "<string>",
"failureReason": "<string>",
"txHash": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z"
}{
"statusCode": 422,
"message": "<string>",
"error": "Unprocessable Entity"
}Refund a payment
A refund is a new payment back to the wallet that paid, in the same coin. LuminPay’s fee is not refunded and LuminPay pays the network fee. The customer never receives more coins than they paid: if the rate moved 1% or less, or in the customer’s favour, they get exactly the coins they paid; if the naira got more than 1% weaker, they get the naira price in coins at today’s rate (fewer coins). You are debited the naira you were credited either way.
Requires an owner, admin or manager signed in to the dashboard, and their PIN. Above your approval limit a second owner or admin must approve it; a business can also hold refunds before sending. Check the result in merchantApprovalStatus, scheduledFor and status. Get a quote first with GET .../quote.
curl --request POST \
--url https://sandbox-api.luminpay.co/charges/{chargeId}/refunds \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": "<string>",
"pin": "<string>",
"expectedSendAmount": "<string>"
}
'import requests
url = "https://sandbox-api.luminpay.co/charges/{chargeId}/refunds"
payload = {
"amount": "<string>",
"pin": "<string>",
"expectedSendAmount": "<string>"
}
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({amount: '<string>', pin: '<string>', expectedSendAmount: '<string>'})
};
fetch('https://sandbox-api.luminpay.co/charges/{chargeId}/refunds', 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-api.luminpay.co/charges/{chargeId}/refunds",
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' => '<string>',
'pin' => '<string>',
'expectedSendAmount' => '<string>'
]),
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://sandbox-api.luminpay.co/charges/{chargeId}/refunds"
payload := strings.NewReader("{\n \"amount\": \"<string>\",\n \"pin\": \"<string>\",\n \"expectedSendAmount\": \"<string>\"\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://sandbox-api.luminpay.co/charges/{chargeId}/refunds")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"<string>\",\n \"pin\": \"<string>\",\n \"expectedSendAmount\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.luminpay.co/charges/{chargeId}/refunds")
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 \"amount\": \"<string>\",\n \"pin\": \"<string>\",\n \"expectedSendAmount\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"refundId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"chargeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": "<string>",
"sendAmount": "<string>",
"asset": "<string>",
"destinationAddress": "<string>",
"status": "pending",
"merchantApprovalStatus": "not_required",
"scheduledFor": "2023-11-07T05:31:56Z",
"rateBasis": "original",
"moveBps": 123,
"merchantDebitKobo": "<string>",
"failureReason": "<string>",
"txHash": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z"
}{
"statusCode": 422,
"message": "<string>",
"error": "Unprocessable Entity"
}Authorizations
Headers
A unique value for this request, 8 to 64 characters (letters, numbers, dots, dashes, underscores, colons). Send the same value when retrying: the first answer is returned with the header Idempotent-Replayed: true and nothing is created twice. Kept for 24 hours. The same key with a different request returns 422; the same key while the first request is still running returns 409.
8 - 64^[A-Za-z0-9._:-]{8,64}$Body
Response
The refund. It may be pending approval or on hold, not yet sent.