Home / Payments
Mobile Money and card payment API
Collect by Mobile Money (Orange Money, MTN MoMo, Moov, Wave) and by card, with a single integration. Payment links, refunds and signed webhooks, testable without moving money.
Quick start
The Warilo payment API collects by Mobile Money and by card with a single call. All requests go through https://api.warilo.com/v1/, in JSON, with your key in the Authorization header.
Three steps to a first payment:
- Request your account: you receive a test key
wk_test_…and a live keywk_live_…. - Create a payment with the test key: no money moves, and the payment goes through every state as in production.
- Replace the test key with the live key on your server.
curl -X POST https://api.warilo.com/v1/payments \
-H "Authorization: Bearer $WARILO_KEY" \
-H "Content-Type: application/json" \
-d '{"amount": 12000, "currency": "EUR", "method": "mobile_money", "operator": "orange_money", "customer": {"phone": "+237673713115", "name": "Awa Ngo"}, "description": "Tuition, first term", "callback_url": "https://votre-site.com/webhooks/warilo"}'const res = await fetch("https://api.warilo.com/v1/payments", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.WARILO_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"amount": 12000,
"currency": "EUR",
"method": "mobile_money",
"operator": "orange_money",
"customer": {
"phone": "+237673713115",
"name": "Awa Ngo"
},
"description": "Tuition, first term",
"callback_url": "https://votre-site.com/webhooks/warilo"
})
});
const data = await res.json();import os, requests
r = requests.post(
"https://api.warilo.com/v1/payments",
headers={"Authorization": f"Bearer {os.environ['WARILO_KEY']}"},
json={
"amount": 12000,
"currency": "EUR",
"method": "mobile_money",
"operator": "orange_money",
"customer": {
"phone": "+237673713115",
"name": "Awa Ngo"
},
"description": "Tuition, first term",
"callback_url": "https://votre-site.com/webhooks/warilo"
},
)
print(r.status_code, r.json())$ch = curl_init("https://api.warilo.com/v1/payments");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("WARILO_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode(json_decode('{"amount": 12000, "currency": "EUR", "method": "mobile_money", "operator": "orange_money", "customer": {"phone": "+237673713115", "name": "Awa Ngo"}, "description": "Tuition, first term", "callback_url": "https://votre-site.com/webhooks/warilo"}')),
]);
$data = json_decode(curl_exec($ch), true);import java.net.URI;
import java.net.http.*;
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder(URI.create("https://api.warilo.com/v1/payments"))
.method("POST", HttpRequest.BodyPublishers.ofString("{\"amount\": 12000, \"currency\": \"EUR\", \"method\": \"mobile_money\", \"operator\": \"orange_money\", \"customer\": {\"phone\": \"+237673713115\", \"name\": \"Awa Ngo\"}, \"description\": \"Tuition, first term\", \"callback_url\": \"https://votre-site.com/webhooks/warilo\"}"))
.header("Authorization", "Bearer " + System.getenv("WARILO_KEY"))
.header("Content-Type", "application/json")
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.warilo.com/v1/payments");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("WARILO_KEY"));
request.Content = new StringContent("{\"amount\": 12000, \"currency\": \"EUR\", \"method\": \"mobile_money\", \"operator\": \"orange_money\", \"customer\": {\"phone\": \"+237673713115\", \"name\": \"Awa Ngo\"}, \"description\": \"Tuition, first term\", \"callback_url\": \"https://votre-site.com/webhooks/warilo\"}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{"amount": 12000, "currency": "EUR", "method": "mobile_money", "operator": "orange_money", "customer": {"phone": "+237673713115", "name": "Awa Ngo"}, "description": "Tuition, first term", "callback_url": "https://votre-site.com/webhooks/warilo"}`)
req, _ := http.NewRequest("POST", "https://api.warilo.com/v1/payments", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("WARILO_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
fmt.Println(res.Status, string(data))
}require "net/http"
require "json"
require "uri"
uri = URI("https://api.warilo.com/v1/payments")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV['WARILO_KEY']}"
req["Content-Type"] = "application/json"
req.body = "{\"amount\": 12000, \"currency\": \"EUR\", \"method\": \"mobile_money\", \"operator\": \"orange_money\", \"customer\": {\"phone\": \"+237673713115\", \"name\": \"Awa Ngo\"}, \"description\": \"Tuition, first term\", \"callback_url\": \"https://votre-site.com/webhooks/warilo\"}"
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
puts "#{res.code} #{res.body}"Response: the payment is created as pending (201). The customer receives an authorisation request; then track the status by webhook or with GET /v1/payments/{id}.
Authentication
Every request carries your key in the Authorization: Bearer wk_… header. The test key starts with wk_test_, the live key with wk_live_: both are used the same way, but only live movements move money.
- A live key is rejected from a browser (
403 live_key_in_browser): keep it on your server. - Keys are created, revoked and rotated in the Warilo Console; a revoked key answers
401 unauthorized. - Amounts are always integers, in minor units: cents for EUR and USD, francs for XOF.
Test mode
The test key lets you verify everything without moving money: payments, links, refunds and webhooks. Created objects carry livemode: false.
- Mobile Money: any E.164 number is accepted; force the outcome with
POST /v1/sandbox/payments/{id}/confirm. - Test cards:
4242 4242 4242 4242succeeds,4000 0000 0000 0002is declined. - Every simulated confirmation triggers the matching webhook, as in production.
curl -X POST https://api.warilo.com/v1/sandbox/payments/pay_3f2a9c0d1e4b5a6f7c8d/confirm \
-H "Authorization: Bearer $WARILO_KEY" \
-H "Content-Type: application/json" \
-d '{"outcome": "succeeded"}'const res = await fetch("https://api.warilo.com/v1/sandbox/payments/pay_3f2a9c0d1e4b5a6f7c8d/confirm", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.WARILO_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"outcome": "succeeded"
})
});
const data = await res.json();import os, requests
r = requests.post(
"https://api.warilo.com/v1/sandbox/payments/pay_3f2a9c0d1e4b5a6f7c8d/confirm",
headers={"Authorization": f"Bearer {os.environ['WARILO_KEY']}"},
json={
"outcome": "succeeded"
},
)
print(r.status_code, r.json())$ch = curl_init("https://api.warilo.com/v1/sandbox/payments/pay_3f2a9c0d1e4b5a6f7c8d/confirm");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("WARILO_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode(json_decode('{"outcome": "succeeded"}')),
]);
$data = json_decode(curl_exec($ch), true);import java.net.URI;
import java.net.http.*;
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder(URI.create("https://api.warilo.com/v1/sandbox/payments/pay_3f2a9c0d1e4b5a6f7c8d/confirm"))
.method("POST", HttpRequest.BodyPublishers.ofString("{\"outcome\": \"succeeded\"}"))
.header("Authorization", "Bearer " + System.getenv("WARILO_KEY"))
.header("Content-Type", "application/json")
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.warilo.com/v1/sandbox/payments/pay_3f2a9c0d1e4b5a6f7c8d/confirm");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("WARILO_KEY"));
request.Content = new StringContent("{\"outcome\": \"succeeded\"}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{"outcome": "succeeded"}`)
req, _ := http.NewRequest("POST", "https://api.warilo.com/v1/sandbox/payments/pay_3f2a9c0d1e4b5a6f7c8d/confirm", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("WARILO_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
fmt.Println(res.Status, string(data))
}require "net/http"
require "json"
require "uri"
uri = URI("https://api.warilo.com/v1/sandbox/payments/pay_3f2a9c0d1e4b5a6f7c8d/confirm")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV['WARILO_KEY']}"
req["Content-Type"] = "application/json"
req.body = "{\"outcome\": \"succeeded\"}"
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
puts "#{res.code} #{res.body}"Create and track a payment
POST /v1/payments creates the payment. The status then changes on Warilo's side: poll GET /v1/payments/{id} after requires_action, and keep webhooks as the main source.
Possible states:
| status | Meaning |
|---|---|
pending | Created, waiting for the customer |
requires_action | The customer must authorise: USSD prompt or 3-D Secure |
processing | Authorised, collection in progress |
succeeded | Collected |
failed | Declined, cancelled or failed; see failure_code |
expired | Not authorised before expiry |
refunded | Collected then fully refunded |
partially_refunded | Collected then partially refunded |
Every request accepts metadata (up to 20 key-value pairs) and callback_url to receive notifications for this payment only.
Mobile Money
A single integration covers Orange Money, MTN MoMo, Moov Money and Wave. Set the operator in operator; Warilo sends an authorisation request to the customer's phone and tracks the response.
- The customer approves by USSD code or notification, depending on the operator.
- An unauthorised payment becomes
expiredafter five minutes; the customer can then create a new one. - XOF amounts are in francs, without decimals.
curl -X POST https://api.warilo.com/v1/payments \
-H "Authorization: Bearer $WARILO_KEY" \
-H "Content-Type: application/json" \
-d '{"amount": 12000, "currency": "EUR", "method": "mobile_money", "operator": "orange_money", "customer": {"phone": "+237673713115", "name": "Awa Ngo"}, "description": "Tuition, first term", "callback_url": "https://votre-site.com/webhooks/warilo"}'const res = await fetch("https://api.warilo.com/v1/payments", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.WARILO_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"amount": 12000,
"currency": "EUR",
"method": "mobile_money",
"operator": "orange_money",
"customer": {
"phone": "+237673713115",
"name": "Awa Ngo"
},
"description": "Tuition, first term",
"callback_url": "https://votre-site.com/webhooks/warilo"
})
});
const data = await res.json();import os, requests
r = requests.post(
"https://api.warilo.com/v1/payments",
headers={"Authorization": f"Bearer {os.environ['WARILO_KEY']}"},
json={
"amount": 12000,
"currency": "EUR",
"method": "mobile_money",
"operator": "orange_money",
"customer": {
"phone": "+237673713115",
"name": "Awa Ngo"
},
"description": "Tuition, first term",
"callback_url": "https://votre-site.com/webhooks/warilo"
},
)
print(r.status_code, r.json())$ch = curl_init("https://api.warilo.com/v1/payments");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("WARILO_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode(json_decode('{"amount": 12000, "currency": "EUR", "method": "mobile_money", "operator": "orange_money", "customer": {"phone": "+237673713115", "name": "Awa Ngo"}, "description": "Tuition, first term", "callback_url": "https://votre-site.com/webhooks/warilo"}')),
]);
$data = json_decode(curl_exec($ch), true);import java.net.URI;
import java.net.http.*;
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder(URI.create("https://api.warilo.com/v1/payments"))
.method("POST", HttpRequest.BodyPublishers.ofString("{\"amount\": 12000, \"currency\": \"EUR\", \"method\": \"mobile_money\", \"operator\": \"orange_money\", \"customer\": {\"phone\": \"+237673713115\", \"name\": \"Awa Ngo\"}, \"description\": \"Tuition, first term\", \"callback_url\": \"https://votre-site.com/webhooks/warilo\"}"))
.header("Authorization", "Bearer " + System.getenv("WARILO_KEY"))
.header("Content-Type", "application/json")
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.warilo.com/v1/payments");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("WARILO_KEY"));
request.Content = new StringContent("{\"amount\": 12000, \"currency\": \"EUR\", \"method\": \"mobile_money\", \"operator\": \"orange_money\", \"customer\": {\"phone\": \"+237673713115\", \"name\": \"Awa Ngo\"}, \"description\": \"Tuition, first term\", \"callback_url\": \"https://votre-site.com/webhooks/warilo\"}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{"amount": 12000, "currency": "EUR", "method": "mobile_money", "operator": "orange_money", "customer": {"phone": "+237673713115", "name": "Awa Ngo"}, "description": "Tuition, first term", "callback_url": "https://votre-site.com/webhooks/warilo"}`)
req, _ := http.NewRequest("POST", "https://api.warilo.com/v1/payments", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("WARILO_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
fmt.Println(res.Status, string(data))
}require "net/http"
require "json"
require "uri"
uri = URI("https://api.warilo.com/v1/payments")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV['WARILO_KEY']}"
req["Content-Type"] = "application/json"
req.body = "{\"amount\": 12000, \"currency\": \"EUR\", \"method\": \"mobile_money\", \"operator\": \"orange_money\", \"customer\": {\"phone\": \"+237673713115\", \"name\": \"Awa Ngo\"}, \"description\": \"Tuition, first term\", \"callback_url\": \"https://votre-site.com/webhooks/warilo\"}"
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
puts "#{res.code} #{res.body}"Bank cards
With method: "card", the response contains checkout_url: redirect the customer to this page, where card entry and 3-D Secure are handled. The payment goes through requires_action then processing.
- Never store card numbers: they never pass through your server.
- At the end, the customer returns to your site; do not trust that return, wait for the webhook or the status.
curl -X POST https://api.warilo.com/v1/payments \
-H "Authorization: Bearer $WARILO_KEY" \
-H "Content-Type: application/json" \
-d '{"amount": 4500, "currency": "EUR", "method": "card", "customer": {"phone": "+237673713115", "email": "[email protected]"}, "description": "Order #1042"}'const res = await fetch("https://api.warilo.com/v1/payments", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.WARILO_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"amount": 4500,
"currency": "EUR",
"method": "card",
"customer": {
"phone": "+237673713115",
"email": "[email protected]"
},
"description": "Order #1042"
})
});
const data = await res.json();import os, requests
r = requests.post(
"https://api.warilo.com/v1/payments",
headers={"Authorization": f"Bearer {os.environ['WARILO_KEY']}"},
json={
"amount": 4500,
"currency": "EUR",
"method": "card",
"customer": {
"phone": "+237673713115",
"email": "[email protected]"
},
"description": "Order #1042"
},
)
print(r.status_code, r.json())$ch = curl_init("https://api.warilo.com/v1/payments");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("WARILO_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode(json_decode('{"amount": 4500, "currency": "EUR", "method": "card", "customer": {"phone": "+237673713115", "email": "[email protected]"}, "description": "Order #1042"}')),
]);
$data = json_decode(curl_exec($ch), true);import java.net.URI;
import java.net.http.*;
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder(URI.create("https://api.warilo.com/v1/payments"))
.method("POST", HttpRequest.BodyPublishers.ofString("{\"amount\": 4500, \"currency\": \"EUR\", \"method\": \"card\", \"customer\": {\"phone\": \"+237673713115\", \"email\": \"[email protected]\"}, \"description\": \"Order #1042\"}"))
.header("Authorization", "Bearer " + System.getenv("WARILO_KEY"))
.header("Content-Type", "application/json")
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.warilo.com/v1/payments");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("WARILO_KEY"));
request.Content = new StringContent("{\"amount\": 4500, \"currency\": \"EUR\", \"method\": \"card\", \"customer\": {\"phone\": \"+237673713115\", \"email\": \"[email protected]\"}, \"description\": \"Order #1042\"}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{"amount": 4500, "currency": "EUR", "method": "card", "customer": {"phone": "+237673713115", "email": "[email protected]"}, "description": "Order #1042"}`)
req, _ := http.NewRequest("POST", "https://api.warilo.com/v1/payments", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("WARILO_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
fmt.Println(res.Status, string(data))
}require "net/http"
require "json"
require "uri"
uri = URI("https://api.warilo.com/v1/payments")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV['WARILO_KEY']}"
req["Content-Type"] = "application/json"
req.body = "{\"amount\": 4500, \"currency\": \"EUR\", \"method\": \"card\", \"customer\": {\"phone\": \"+237673713115\", \"email\": \"[email protected]\"}, \"description\": \"Order #1042\"}"
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
puts "#{res.code} #{res.body}"Links and QR codes
A payment link is a page you can share by WhatsApp, SMS or QR code. Without amount, the customer enters the amount themselves.
urlis shared as is;qr_urlreturns an SVG QR code, to print or display.- A link becomes
paidon the first successful payment, and fires thelink.paidevent. POST /v1/links/{id}/closedisables a still-active link.
curl -X POST https://api.warilo.com/v1/links \
-H "Authorization: Bearer $WARILO_KEY" \
-H "Content-Type: application/json" \
-d '{"amount": 4500, "currency": "EUR", "description": "Order #1042", "expires_at": "2026-11-04T23:59:59Z"}'const res = await fetch("https://api.warilo.com/v1/links", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.WARILO_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"amount": 4500,
"currency": "EUR",
"description": "Order #1042",
"expires_at": "2026-11-04T23:59:59Z"
})
});
const data = await res.json();import os, requests
r = requests.post(
"https://api.warilo.com/v1/links",
headers={"Authorization": f"Bearer {os.environ['WARILO_KEY']}"},
json={
"amount": 4500,
"currency": "EUR",
"description": "Order #1042",
"expires_at": "2026-11-04T23:59:59Z"
},
)
print(r.status_code, r.json())$ch = curl_init("https://api.warilo.com/v1/links");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("WARILO_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode(json_decode('{"amount": 4500, "currency": "EUR", "description": "Order #1042", "expires_at": "2026-11-04T23:59:59Z"}')),
]);
$data = json_decode(curl_exec($ch), true);import java.net.URI;
import java.net.http.*;
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder(URI.create("https://api.warilo.com/v1/links"))
.method("POST", HttpRequest.BodyPublishers.ofString("{\"amount\": 4500, \"currency\": \"EUR\", \"description\": \"Order #1042\", \"expires_at\": \"2026-11-04T23:59:59Z\"}"))
.header("Authorization", "Bearer " + System.getenv("WARILO_KEY"))
.header("Content-Type", "application/json")
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.warilo.com/v1/links");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("WARILO_KEY"));
request.Content = new StringContent("{\"amount\": 4500, \"currency\": \"EUR\", \"description\": \"Order #1042\", \"expires_at\": \"2026-11-04T23:59:59Z\"}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{"amount": 4500, "currency": "EUR", "description": "Order #1042", "expires_at": "2026-11-04T23:59:59Z"}`)
req, _ := http.NewRequest("POST", "https://api.warilo.com/v1/links", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("WARILO_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
fmt.Println(res.Status, string(data))
}require "net/http"
require "json"
require "uri"
uri = URI("https://api.warilo.com/v1/links")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV['WARILO_KEY']}"
req["Content-Type"] = "application/json"
req.body = "{\"amount\": 4500, \"currency\": \"EUR\", \"description\": \"Order #1042\", \"expires_at\": \"2026-11-04T23:59:59Z\"}"
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
puts "#{res.code} #{res.body}"Refunds
Refund all or part of a succeeded payment with POST /v1/payments/{id}/refund. Without amount, the refund is full.
- Several partial refunds are possible, up to the collected amount.
- The payment becomes
partially_refundedorrefunded; therefund.succeededevent confirms completion. - With Mobile Money, the refund goes back to the original account.
curl -X POST https://api.warilo.com/v1/payments/pay_3f2a9c0d1e4b5a6f7c8d/refund \
-H "Authorization: Bearer $WARILO_KEY" \
-H "Content-Type: application/json" \
-d '{"amount": 2500, "reason": "article_retourne"}'const res = await fetch("https://api.warilo.com/v1/payments/pay_3f2a9c0d1e4b5a6f7c8d/refund", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.WARILO_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"amount": 2500,
"reason": "article_retourne"
})
});
const data = await res.json();import os, requests
r = requests.post(
"https://api.warilo.com/v1/payments/pay_3f2a9c0d1e4b5a6f7c8d/refund",
headers={"Authorization": f"Bearer {os.environ['WARILO_KEY']}"},
json={
"amount": 2500,
"reason": "article_retourne"
},
)
print(r.status_code, r.json())$ch = curl_init("https://api.warilo.com/v1/payments/pay_3f2a9c0d1e4b5a6f7c8d/refund");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("WARILO_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode(json_decode('{"amount": 2500, "reason": "article_retourne"}')),
]);
$data = json_decode(curl_exec($ch), true);import java.net.URI;
import java.net.http.*;
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder(URI.create("https://api.warilo.com/v1/payments/pay_3f2a9c0d1e4b5a6f7c8d/refund"))
.method("POST", HttpRequest.BodyPublishers.ofString("{\"amount\": 2500, \"reason\": \"article_retourne\"}"))
.header("Authorization", "Bearer " + System.getenv("WARILO_KEY"))
.header("Content-Type", "application/json")
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.warilo.com/v1/payments/pay_3f2a9c0d1e4b5a6f7c8d/refund");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("WARILO_KEY"));
request.Content = new StringContent("{\"amount\": 2500, \"reason\": \"article_retourne\"}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{"amount": 2500, "reason": "article_retourne"}`)
req, _ := http.NewRequest("POST", "https://api.warilo.com/v1/payments/pay_3f2a9c0d1e4b5a6f7c8d/refund", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("WARILO_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
fmt.Println(res.Status, string(data))
}require "net/http"
require "json"
require "uri"
uri = URI("https://api.warilo.com/v1/payments/pay_3f2a9c0d1e4b5a6f7c8d/refund")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV['WARILO_KEY']}"
req["Content-Type"] = "application/json"
req.body = "{\"amount\": 2500, \"reason\": \"article_retourne\"}"
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
puts "#{res.code} #{res.body}"Webhooks
Declare an https:// address in the Warilo Console. Every status change is sent to it as a JSON POST; the configuration response contains a secret, shown only once.
- Expected response: a 2xx code within 10 seconds. Otherwise, retries after 1 min, 5 min, 30 min, 2 h, 6 h and 24 h.
- Duplicates: the same event may arrive twice; deduplicate with the
Warilo-Event-Idheader. - Signature: check the
Warilo-Signature: t=…,v1=…header, an HMAC-SHA256 oft.bodycomputed with your secret. Reject events older than five minutes.
| Event | Meaning |
|---|---|
payment.succeeded | Payment collected; data.payment contains the payment. |
payment.failed | Payment declined, cancelled or expired; failure_code gives the cause. |
refund.succeeded | Refund completed; data.refund contains the refund. |
link.paid | Payment link paid; data.link contains the link and its payment_id. |
Verify the signature
import crypto from "node:crypto";
// rawBody : le corps exact reçu (Buffer), avant tout JSON.parse
export function verifyWarilo(rawBody, header, secret) {
const parts = Object.fromEntries(header.split(",").map(p => p.split("=")));
const expected = crypto.createHmac("sha256", secret)
.update(`${parts.t}.`).update(rawBody).digest("hex");
const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) < 300;
return fresh && crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1));
}import hashlib, hmac, time
def verify_warilo(raw_body: bytes, header: str, secret: str) -> bool:
parts = dict(p.split("=", 1) for p in header.split(","))
expected = hmac.new(secret.encode(), f"{parts['t']}.".encode() + raw_body, hashlib.sha256).hexdigest()
fresh = abs(time.time() - int(parts["t"])) < 300
return fresh and hmac.compare_digest(expected, parts["v1"])function verify_warilo(string $rawBody, string $header, string $secret): bool {
parse_str(str_replace(',', '&', $header), $p);
$expected = hash_hmac('sha256', $p['t'] . '.' . $rawBody, $secret);
$fresh = abs(time() - (int) $p['t']) < 300;
return $fresh && hash_equals($expected, $p['v1']);
}import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.util.HashMap;
import java.util.HexFormat;
import java.util.Map;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
public static boolean verifyWarilo(byte[] rawBody, String header, String secret) throws Exception {
Map<String, String> parts = new HashMap<>();
for (String p : header.split(",")) {
String[] kv = p.split("=", 2);
parts.put(kv[0].trim(), kv[1].trim());
}
Mac mac = Mac.getInstance("HmacSHA256");
mac.init(new SecretKeySpec(secret.getBytes(StandardCharsets.UTF_8), "HmacSHA256"));
mac.update((parts.get("t") + ".").getBytes(StandardCharsets.UTF_8));
byte[] expected = mac.doFinal(rawBody);
boolean fresh = Math.abs(System.currentTimeMillis() / 1000 - Long.parseLong(parts.get("t"))) < 300;
return fresh && MessageDigest.isEqual(expected, HexFormat.of().parseHex(parts.get("v1")));
}using System.Linq;
using System.Security.Cryptography;
using System.Text;
static bool VerifyWarilo(byte[] rawBody, string header, string secret)
{
var parts = header.Split(',').Select(p => p.Split('=', 2)).ToDictionary(kv => kv[0], kv => kv[1]);
using var hmac = IncrementalHash.CreateHMAC(HashAlgorithmName.SHA256, Encoding.UTF8.GetBytes(secret));
hmac.AppendData(Encoding.UTF8.GetBytes(parts["t"] + "."));
hmac.AppendData(rawBody);
var expected = hmac.GetHashAndReset();
var fresh = Math.Abs(DateTimeOffset.UtcNow.ToUnixTimeSeconds() - long.Parse(parts["t"])) < 300;
return fresh && CryptographicOperations.FixedTimeEquals(expected, Convert.FromHexString(parts["v1"]));
}import (
"crypto/hmac"
"crypto/sha256"
"encoding/hex"
"strconv"
"strings"
"time"
)
func verifyWarilo(rawBody []byte, header, secret string) bool {
parts := map[string]string{}
for _, p := range strings.Split(header, ",") {
kv := strings.SplitN(p, "=", 2)
parts[kv[0]] = kv[1]
}
mac := hmac.New(sha256.New, []byte(secret))
mac.Write([]byte(parts["t"] + "."))
mac.Write(rawBody)
expected := hex.EncodeToString(mac.Sum(nil))
t, _ := strconv.ParseInt(parts["t"], 10, 64)
fresh := time.Since(time.Unix(t, 0)) < 5*time.Minute
return fresh && hmac.Equal([]byte(expected), []byte(parts["v1"]))
}require "openssl"
def verify_warilo(raw_body, header, secret)
parts = header.split(",").to_h { |p| p.split("=", 2) }
expected = OpenSSL::HMAC.hexdigest("SHA256", secret, "#{parts['t']}.#{raw_body}")
fresh = (Time.now.to_i - parts["t"].to_i).abs < 300
fresh && OpenSSL.fixed_length_secure_compare(expected, parts["v1"])
endSample event
{
"id": "evt_7a8b9c0d1e2f3a4b5c6d",
"object": "event",
"type": "payment.succeeded",
"created_at": "2026-10-28T09:16:12Z",
"data": {
"payment": {
"id": "pay_3f2a9c0d1e4b5a6f7c8d",
"object": "payment",
"status": "succeeded",
"amount": 12000,
"currency": "EUR",
"method": "mobile_money",
"operator": "orange_money",
"livemode": false,
"created_at": "2026-10-28T09:15:00Z"
}
}
}Errors
Errors always have the same shape: {"error": {"code": "…", "message": "…"}}. Your code should rely on code, which stays stable; message is meant for humans. The most common codes:
| HTTP | code | Meaning |
|---|---|---|
| 401 | unauthorized | Missing, invalid or revoked key |
| 403 | live_key_in_browser | Live key used from a browser |
| 403 | test_keys_only | Endpoint restricted to test keys |
| 404 | not_found | Payment or link not found |
| 409 | invalid_state | Operation not allowed in this state (refund, link closing) |
| 422 | invalid_amount | Amount below the minimum or above the refundable balance |
| 422 | invalid_currency | Unsupported currency (EUR, USD, XOF) |
| 422 | unsupported_method | Payment method or operator unavailable for this currency |
| 422 | phone_invalid | Number not in international E.164 format |
| 429 | rate_limited | Too many requests: retry with increasing delay |
| 500 | internal | Error on our side: request_id lets us trace it |
API reference
Create a payment
POST/v1/payments
Creates a payment and returns its identifier. With Mobile Money, an authorisation request (USSD) is sent to the customer; with card, checkout_url redirects to the secure payment page. The final status arrives by webhook or with GET /v1/payments/{id}.
Request body
| Field | Type | Description |
|---|---|---|
amount required | integer | Amount in minor units: cents for EUR and USD, francs for XOF. |
currency required | EUR | USD | XOF | Payment currency. |
method required | mobile_money | card | Payment method. |
operator | orange_money | mtn_momo | moov_money | wave | Mobile Money operator; required with method mobile_money. |
customer required | object | |
description | string | Label shown on the receipt and in the console. |
callback_url | string | https address to call for this payment only (in addition to the account webhook). |
metadata | object | Up to 20 key-value pairs stored with the payment. |
Example
curl -X POST https://api.warilo.com/v1/payments \
-H "Authorization: Bearer $WARILO_KEY" \
-H "Content-Type: application/json" \
-d '{"amount": 12000, "currency": "EUR", "method": "mobile_money", "operator": "orange_money", "customer": {"phone": "+237673713115", "name": "Awa Ngo"}, "description": "Tuition, first term", "callback_url": "https://votre-site.com/webhooks/warilo"}'const res = await fetch("https://api.warilo.com/v1/payments", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.WARILO_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"amount": 12000,
"currency": "EUR",
"method": "mobile_money",
"operator": "orange_money",
"customer": {
"phone": "+237673713115",
"name": "Awa Ngo"
},
"description": "Tuition, first term",
"callback_url": "https://votre-site.com/webhooks/warilo"
})
});
const data = await res.json();import os, requests
r = requests.post(
"https://api.warilo.com/v1/payments",
headers={"Authorization": f"Bearer {os.environ['WARILO_KEY']}"},
json={
"amount": 12000,
"currency": "EUR",
"method": "mobile_money",
"operator": "orange_money",
"customer": {
"phone": "+237673713115",
"name": "Awa Ngo"
},
"description": "Tuition, first term",
"callback_url": "https://votre-site.com/webhooks/warilo"
},
)
print(r.status_code, r.json())$ch = curl_init("https://api.warilo.com/v1/payments");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("WARILO_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode(json_decode('{"amount": 12000, "currency": "EUR", "method": "mobile_money", "operator": "orange_money", "customer": {"phone": "+237673713115", "name": "Awa Ngo"}, "description": "Tuition, first term", "callback_url": "https://votre-site.com/webhooks/warilo"}')),
]);
$data = json_decode(curl_exec($ch), true);import java.net.URI;
import java.net.http.*;
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder(URI.create("https://api.warilo.com/v1/payments"))
.method("POST", HttpRequest.BodyPublishers.ofString("{\"amount\": 12000, \"currency\": \"EUR\", \"method\": \"mobile_money\", \"operator\": \"orange_money\", \"customer\": {\"phone\": \"+237673713115\", \"name\": \"Awa Ngo\"}, \"description\": \"Tuition, first term\", \"callback_url\": \"https://votre-site.com/webhooks/warilo\"}"))
.header("Authorization", "Bearer " + System.getenv("WARILO_KEY"))
.header("Content-Type", "application/json")
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.warilo.com/v1/payments");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("WARILO_KEY"));
request.Content = new StringContent("{\"amount\": 12000, \"currency\": \"EUR\", \"method\": \"mobile_money\", \"operator\": \"orange_money\", \"customer\": {\"phone\": \"+237673713115\", \"name\": \"Awa Ngo\"}, \"description\": \"Tuition, first term\", \"callback_url\": \"https://votre-site.com/webhooks/warilo\"}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{"amount": 12000, "currency": "EUR", "method": "mobile_money", "operator": "orange_money", "customer": {"phone": "+237673713115", "name": "Awa Ngo"}, "description": "Tuition, first term", "callback_url": "https://votre-site.com/webhooks/warilo"}`)
req, _ := http.NewRequest("POST", "https://api.warilo.com/v1/payments", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("WARILO_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
fmt.Println(res.Status, string(data))
}require "net/http"
require "json"
require "uri"
uri = URI("https://api.warilo.com/v1/payments")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV['WARILO_KEY']}"
req["Content-Type"] = "application/json"
req.body = "{\"amount\": 12000, \"currency\": \"EUR\", \"method\": \"mobile_money\", \"operator\": \"orange_money\", \"customer\": {\"phone\": \"+237673713115\", \"name\": \"Awa Ngo\"}, \"description\": \"Tuition, first term\", \"callback_url\": \"https://votre-site.com/webhooks/warilo\"}"
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
puts "#{res.code} #{res.body}"Response 201
{
"id": "pay_3f2a9c0d1e4b5a6f7c8d",
"object": "payment",
"status": "pending",
"amount": 12000,
"currency": "EUR",
"method": "mobile_money",
"operator": "orange_money",
"customer": {
"phone": "+237673713115",
"name": "Awa Ngo"
},
"description": "Tuition, first term",
"checkout_url": null,
"refunded_amount": 0,
"failure_code": null,
"livemode": false,
"created_at": "2026-10-28T09:15:00Z",
"expires_at": "2026-10-28T09:20:00Z"
}List payments
GET/v1/payments
Returns the account's payments, newest first. Cursor pagination with next_cursor.
Parameters
| Name | In | Description |
|---|---|---|
limit | query | Payments per page (1 to 100, 20 by default). |
status | query | Filter by status. |
from | query | Start date (ISO 8601). |
to | query | End date (ISO 8601). |
cursor | query | Cursor returned by the previous page. |
Example
curl -X GET https://api.warilo.com/v1/payments \
-H "Authorization: Bearer $WARILO_KEY"const res = await fetch("https://api.warilo.com/v1/payments", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.WARILO_KEY}`
}
});
const data = await res.json();import os, requests
r = requests.get(
"https://api.warilo.com/v1/payments",
headers={"Authorization": f"Bearer {os.environ['WARILO_KEY']}"},
)
print(r.status_code, r.json())$ch = curl_init("https://api.warilo.com/v1/payments");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("WARILO_KEY"), "Content-Type: application/json"],
]);
$data = json_decode(curl_exec($ch), true);import java.net.URI;
import java.net.http.*;
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder(URI.create("https://api.warilo.com/v1/payments"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.header("Authorization", "Bearer " + System.getenv("WARILO_KEY"))
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.warilo.com/v1/payments");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("WARILO_KEY"));
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.warilo.com/v1/payments", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("WARILO_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
fmt.Println(res.Status, string(data))
}require "net/http"
require "json"
require "uri"
uri = URI("https://api.warilo.com/v1/payments")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer #{ENV['WARILO_KEY']}"
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
puts "#{res.code} #{res.body}"Response 200
{
"data": [
{
"id": "pay_3f2a9c0d1e4b5a6f7c8d",
"object": "payment",
"status": "succeeded",
"amount": 12000,
"currency": "EUR",
"method": "mobile_money",
"operator": "orange_money",
"created_at": "2026-10-28T09:15:00Z"
},
{
"id": "pay_9b8c7d6e5f4a3b2c1d0e",
"object": "payment",
"status": "refunded",
"amount": 4500,
"currency": "EUR",
"method": "card",
"operator": null,
"created_at": "2026-10-27T16:40:00Z"
}
],
"next_cursor": "pay_9b8c7d6e5f4a3b2c1d0e"
}Retrieve a payment
GET/v1/payments/{id}
Returns the payment's current state. Poll it after requires_action and as a fallback to webhooks.
Parameters
| Name | In | Description |
|---|---|---|
id required | path | Payment identifier (pay_…). |
Example
curl -X GET https://api.warilo.com/v1/payments/pay_3f2a9c0d1e4b5a6f7c8d \
-H "Authorization: Bearer $WARILO_KEY"const res = await fetch("https://api.warilo.com/v1/payments/pay_3f2a9c0d1e4b5a6f7c8d", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.WARILO_KEY}`
}
});
const data = await res.json();import os, requests
r = requests.get(
"https://api.warilo.com/v1/payments/pay_3f2a9c0d1e4b5a6f7c8d",
headers={"Authorization": f"Bearer {os.environ['WARILO_KEY']}"},
)
print(r.status_code, r.json())$ch = curl_init("https://api.warilo.com/v1/payments/pay_3f2a9c0d1e4b5a6f7c8d");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("WARILO_KEY"), "Content-Type: application/json"],
]);
$data = json_decode(curl_exec($ch), true);import java.net.URI;
import java.net.http.*;
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder(URI.create("https://api.warilo.com/v1/payments/pay_3f2a9c0d1e4b5a6f7c8d"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.header("Authorization", "Bearer " + System.getenv("WARILO_KEY"))
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.warilo.com/v1/payments/pay_3f2a9c0d1e4b5a6f7c8d");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("WARILO_KEY"));
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.warilo.com/v1/payments/pay_3f2a9c0d1e4b5a6f7c8d", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("WARILO_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
fmt.Println(res.Status, string(data))
}require "net/http"
require "json"
require "uri"
uri = URI("https://api.warilo.com/v1/payments/pay_3f2a9c0d1e4b5a6f7c8d")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer #{ENV['WARILO_KEY']}"
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
puts "#{res.code} #{res.body}"Response 200
{
"id": "pay_3f2a9c0d1e4b5a6f7c8d",
"object": "payment",
"status": "succeeded",
"amount": 12000,
"currency": "EUR",
"method": "mobile_money",
"operator": "orange_money",
"customer": {
"phone": "+237673713115",
"name": "Awa Ngo"
},
"description": "Tuition, first term",
"checkout_url": null,
"refunded_amount": 0,
"failure_code": null,
"livemode": false,
"created_at": "2026-10-28T09:15:00Z",
"expires_at": "2026-10-28T09:20:00Z"
}Create a payment link
POST/v1/links
Creates a shareable payment page (WhatsApp, SMS, QR code). Without amount, the link is open-amount: the customer enters the amount.
Request body
| Field | Type | Description |
|---|---|---|
amount | integer | Amount in minor units; omitted, the customer chooses the amount. |
currency required | EUR | USD | XOF | |
description required | string | Link purpose, shown on the payment page. |
expires_at | string | Link expiry date. |
callback_url | string | https address called when the link is paid. |
Example
curl -X POST https://api.warilo.com/v1/links \
-H "Authorization: Bearer $WARILO_KEY" \
-H "Content-Type: application/json" \
-d '{"amount": 4500, "currency": "EUR", "description": "Order #1042", "expires_at": "2026-11-04T23:59:59Z"}'const res = await fetch("https://api.warilo.com/v1/links", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.WARILO_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"amount": 4500,
"currency": "EUR",
"description": "Order #1042",
"expires_at": "2026-11-04T23:59:59Z"
})
});
const data = await res.json();import os, requests
r = requests.post(
"https://api.warilo.com/v1/links",
headers={"Authorization": f"Bearer {os.environ['WARILO_KEY']}"},
json={
"amount": 4500,
"currency": "EUR",
"description": "Order #1042",
"expires_at": "2026-11-04T23:59:59Z"
},
)
print(r.status_code, r.json())$ch = curl_init("https://api.warilo.com/v1/links");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("WARILO_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode(json_decode('{"amount": 4500, "currency": "EUR", "description": "Order #1042", "expires_at": "2026-11-04T23:59:59Z"}')),
]);
$data = json_decode(curl_exec($ch), true);import java.net.URI;
import java.net.http.*;
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder(URI.create("https://api.warilo.com/v1/links"))
.method("POST", HttpRequest.BodyPublishers.ofString("{\"amount\": 4500, \"currency\": \"EUR\", \"description\": \"Order #1042\", \"expires_at\": \"2026-11-04T23:59:59Z\"}"))
.header("Authorization", "Bearer " + System.getenv("WARILO_KEY"))
.header("Content-Type", "application/json")
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.warilo.com/v1/links");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("WARILO_KEY"));
request.Content = new StringContent("{\"amount\": 4500, \"currency\": \"EUR\", \"description\": \"Order #1042\", \"expires_at\": \"2026-11-04T23:59:59Z\"}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{"amount": 4500, "currency": "EUR", "description": "Order #1042", "expires_at": "2026-11-04T23:59:59Z"}`)
req, _ := http.NewRequest("POST", "https://api.warilo.com/v1/links", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("WARILO_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
fmt.Println(res.Status, string(data))
}require "net/http"
require "json"
require "uri"
uri = URI("https://api.warilo.com/v1/links")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV['WARILO_KEY']}"
req["Content-Type"] = "application/json"
req.body = "{\"amount\": 4500, \"currency\": \"EUR\", \"description\": \"Order #1042\", \"expires_at\": \"2026-11-04T23:59:59Z\"}"
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
puts "#{res.code} #{res.body}"Response 201
{
"id": "lnk_9b2c3d4e5f6a7b8c9d0e",
"object": "link",
"status": "active",
"url": "https://pay.warilo.com/l/lnk_9b2c3d4e5f6a7b8c9d0e",
"qr_url": "https://pay.warilo.com/l/lnk_9b2c3d4e5f6a7b8c9d0e/qr.svg",
"amount": 4500,
"currency": "EUR",
"description": "Order #1042",
"payment_id": null,
"created_at": "2026-10-28T11:20:00Z",
"expires_at": "2026-11-04T23:59:59Z"
}Retrieve a link
GET/v1/links/{id}
Returns the link state: active, paid, expired or closed. payment_id gives the payment once the link is paid.
Parameters
| Name | In | Description |
|---|---|---|
id required | path | Link identifier (lnk_…). |
Example
curl -X GET https://api.warilo.com/v1/links/lnk_9b2c3d4e5f6a7b8c9d0e \
-H "Authorization: Bearer $WARILO_KEY"const res = await fetch("https://api.warilo.com/v1/links/lnk_9b2c3d4e5f6a7b8c9d0e", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.WARILO_KEY}`
}
});
const data = await res.json();import os, requests
r = requests.get(
"https://api.warilo.com/v1/links/lnk_9b2c3d4e5f6a7b8c9d0e",
headers={"Authorization": f"Bearer {os.environ['WARILO_KEY']}"},
)
print(r.status_code, r.json())$ch = curl_init("https://api.warilo.com/v1/links/lnk_9b2c3d4e5f6a7b8c9d0e");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("WARILO_KEY"), "Content-Type: application/json"],
]);
$data = json_decode(curl_exec($ch), true);import java.net.URI;
import java.net.http.*;
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder(URI.create("https://api.warilo.com/v1/links/lnk_9b2c3d4e5f6a7b8c9d0e"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.header("Authorization", "Bearer " + System.getenv("WARILO_KEY"))
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.warilo.com/v1/links/lnk_9b2c3d4e5f6a7b8c9d0e");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("WARILO_KEY"));
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.warilo.com/v1/links/lnk_9b2c3d4e5f6a7b8c9d0e", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("WARILO_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
fmt.Println(res.Status, string(data))
}require "net/http"
require "json"
require "uri"
uri = URI("https://api.warilo.com/v1/links/lnk_9b2c3d4e5f6a7b8c9d0e")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer #{ENV['WARILO_KEY']}"
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
puts "#{res.code} #{res.body}"Response 200
{
"id": "lnk_9b2c3d4e5f6a7b8c9d0e",
"object": "link",
"status": "paid",
"url": "https://pay.warilo.com/l/lnk_9b2c3d4e5f6a7b8c9d0e",
"qr_url": "https://pay.warilo.com/l/lnk_9b2c3d4e5f6a7b8c9d0e/qr.svg",
"amount": 4500,
"currency": "EUR",
"description": "Order #1042",
"payment_id": "pay_1a2b3c4d5e6f7a8b9c0d",
"created_at": "2026-10-28T11:20:00Z",
"expires_at": "2026-11-04T23:59:59Z"
}Close a link
POST/v1/links/{id}/close
Disables an active link: the payment page no longer accepts payments. Paid links cannot be closed.
Parameters
| Name | In | Description |
|---|---|---|
id required | path | Link identifier (lnk_…). |
Example
curl -X POST https://api.warilo.com/v1/links/lnk_9b2c3d4e5f6a7b8c9d0e/close \
-H "Authorization: Bearer $WARILO_KEY"const res = await fetch("https://api.warilo.com/v1/links/lnk_9b2c3d4e5f6a7b8c9d0e/close", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.WARILO_KEY}`
}
});
const data = await res.json();import os, requests
r = requests.post(
"https://api.warilo.com/v1/links/lnk_9b2c3d4e5f6a7b8c9d0e/close",
headers={"Authorization": f"Bearer {os.environ['WARILO_KEY']}"},
)
print(r.status_code, r.json())$ch = curl_init("https://api.warilo.com/v1/links/lnk_9b2c3d4e5f6a7b8c9d0e/close");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("WARILO_KEY"), "Content-Type: application/json"],
]);
$data = json_decode(curl_exec($ch), true);import java.net.URI;
import java.net.http.*;
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder(URI.create("https://api.warilo.com/v1/links/lnk_9b2c3d4e5f6a7b8c9d0e/close"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.header("Authorization", "Bearer " + System.getenv("WARILO_KEY"))
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.warilo.com/v1/links/lnk_9b2c3d4e5f6a7b8c9d0e/close");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("WARILO_KEY"));
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("POST", "https://api.warilo.com/v1/links/lnk_9b2c3d4e5f6a7b8c9d0e/close", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("WARILO_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
fmt.Println(res.Status, string(data))
}require "net/http"
require "json"
require "uri"
uri = URI("https://api.warilo.com/v1/links/lnk_9b2c3d4e5f6a7b8c9d0e/close")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV['WARILO_KEY']}"
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
puts "#{res.code} #{res.body}"Response 200
{
"id": "lnk_9b2c3d4e5f6a7b8c9d0e",
"object": "link",
"status": "closed",
"url": "https://pay.warilo.com/l/lnk_9b2c3d4e5f6a7b8c9d0e",
"qr_url": "https://pay.warilo.com/l/lnk_9b2c3d4e5f6a7b8c9d0e/qr.svg",
"amount": 4500,
"currency": "EUR",
"description": "Order #1042",
"payment_id": null,
"created_at": "2026-10-28T11:20:00Z",
"expires_at": "2026-11-04T23:59:59Z"
}Refund a payment
POST/v1/payments/{id}/refund
Refunds all or part of a succeeded payment. Without amount, the refund is full. Several partial refunds are possible up to the collected amount.
Parameters
| Name | In | Description |
|---|---|---|
id required | path | Payment identifier (pay_…). |
Request body
| Field | Type | Description |
|---|---|---|
amount | integer | Amount to refund in minor units; omitted, full refund. |
reason | article_retourne | double_paiement | fraude | demande_client | Refund reason. |
Example
curl -X POST https://api.warilo.com/v1/payments/pay_3f2a9c0d1e4b5a6f7c8d/refund \
-H "Authorization: Bearer $WARILO_KEY" \
-H "Content-Type: application/json" \
-d '{"amount": 2500, "reason": "article_retourne"}'const res = await fetch("https://api.warilo.com/v1/payments/pay_3f2a9c0d1e4b5a6f7c8d/refund", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.WARILO_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"amount": 2500,
"reason": "article_retourne"
})
});
const data = await res.json();import os, requests
r = requests.post(
"https://api.warilo.com/v1/payments/pay_3f2a9c0d1e4b5a6f7c8d/refund",
headers={"Authorization": f"Bearer {os.environ['WARILO_KEY']}"},
json={
"amount": 2500,
"reason": "article_retourne"
},
)
print(r.status_code, r.json())$ch = curl_init("https://api.warilo.com/v1/payments/pay_3f2a9c0d1e4b5a6f7c8d/refund");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("WARILO_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode(json_decode('{"amount": 2500, "reason": "article_retourne"}')),
]);
$data = json_decode(curl_exec($ch), true);import java.net.URI;
import java.net.http.*;
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder(URI.create("https://api.warilo.com/v1/payments/pay_3f2a9c0d1e4b5a6f7c8d/refund"))
.method("POST", HttpRequest.BodyPublishers.ofString("{\"amount\": 2500, \"reason\": \"article_retourne\"}"))
.header("Authorization", "Bearer " + System.getenv("WARILO_KEY"))
.header("Content-Type", "application/json")
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.warilo.com/v1/payments/pay_3f2a9c0d1e4b5a6f7c8d/refund");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("WARILO_KEY"));
request.Content = new StringContent("{\"amount\": 2500, \"reason\": \"article_retourne\"}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{"amount": 2500, "reason": "article_retourne"}`)
req, _ := http.NewRequest("POST", "https://api.warilo.com/v1/payments/pay_3f2a9c0d1e4b5a6f7c8d/refund", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("WARILO_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
fmt.Println(res.Status, string(data))
}require "net/http"
require "json"
require "uri"
uri = URI("https://api.warilo.com/v1/payments/pay_3f2a9c0d1e4b5a6f7c8d/refund")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV['WARILO_KEY']}"
req["Content-Type"] = "application/json"
req.body = "{\"amount\": 2500, \"reason\": \"article_retourne\"}"
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
puts "#{res.code} #{res.body}"Response 201
{
"id": "ref_5d4c3b2a1f0e9d8c7b6a",
"object": "refund",
"payment_id": "pay_3f2a9c0d1e4b5a6f7c8d",
"amount": 2500,
"status": "processing",
"reason": "article_retourne",
"created_at": "2026-10-28T10:02:00Z"
}Retrieve the balance
GET/v1/balance
Available balance (payouts possible) and pending balance (payments in progress), per currency.
Example
curl -X GET https://api.warilo.com/v1/balance \
-H "Authorization: Bearer $WARILO_KEY"const res = await fetch("https://api.warilo.com/v1/balance", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.WARILO_KEY}`
}
});
const data = await res.json();import os, requests
r = requests.get(
"https://api.warilo.com/v1/balance",
headers={"Authorization": f"Bearer {os.environ['WARILO_KEY']}"},
)
print(r.status_code, r.json())$ch = curl_init("https://api.warilo.com/v1/balance");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("WARILO_KEY"), "Content-Type: application/json"],
]);
$data = json_decode(curl_exec($ch), true);import java.net.URI;
import java.net.http.*;
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder(URI.create("https://api.warilo.com/v1/balance"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.header("Authorization", "Bearer " + System.getenv("WARILO_KEY"))
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.warilo.com/v1/balance");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("WARILO_KEY"));
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.warilo.com/v1/balance", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("WARILO_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
fmt.Println(res.Status, string(data))
}require "net/http"
require "json"
require "uri"
uri = URI("https://api.warilo.com/v1/balance")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer #{ENV['WARILO_KEY']}"
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
puts "#{res.code} #{res.body}"Response 200
{
"object": "balance",
"available": [
{
"currency": "EUR",
"amount": 184250
},
{
"currency": "USD",
"amount": 32000
},
{
"currency": "XOF",
"amount": 750000
}
],
"pending": [
{
"currency": "EUR",
"amount": 4500
}
]
}Service status
GET/v1/healthno authentication
Availability check, without authentication.
Example
curl -X GET https://api.warilo.com/v1/health \
-H "Authorization: Bearer $WARILO_KEY"const res = await fetch("https://api.warilo.com/v1/health", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.WARILO_KEY}`
}
});
const data = await res.json();import os, requests
r = requests.get(
"https://api.warilo.com/v1/health",
headers={"Authorization": f"Bearer {os.environ['WARILO_KEY']}"},
)
print(r.status_code, r.json())$ch = curl_init("https://api.warilo.com/v1/health");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("WARILO_KEY"), "Content-Type: application/json"],
]);
$data = json_decode(curl_exec($ch), true);import java.net.URI;
import java.net.http.*;
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder(URI.create("https://api.warilo.com/v1/health"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.header("Authorization", "Bearer " + System.getenv("WARILO_KEY"))
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.warilo.com/v1/health");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("WARILO_KEY"));
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.warilo.com/v1/health", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("WARILO_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
fmt.Println(res.Status, string(data))
}require "net/http"
require "json"
require "uri"
uri = URI("https://api.warilo.com/v1/health")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer #{ENV['WARILO_KEY']}"
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
puts "#{res.code} #{res.body}"Response 200
{
"status": "ok",
"version": "1.0.0"
}Simulate a payment outcome
POST/v1/sandbox/payments/{id}/confirm
Test keys only: forces the payment to succeed or fail, and triggers the matching webhook. No real money moves.
Parameters
| Name | In | Description |
|---|---|---|
id required | path | Payment identifier (pay_…). |
Request body
| Field | Type | Description |
|---|---|---|
outcome required | succeeded | failed | Outcome to simulate. |
failure_code | declined | insufficient_funds | timeout | cancelled | Failure cause, with outcome failed. |
Example
curl -X POST https://api.warilo.com/v1/sandbox/payments/pay_3f2a9c0d1e4b5a6f7c8d/confirm \
-H "Authorization: Bearer $WARILO_KEY" \
-H "Content-Type: application/json" \
-d '{"outcome": "succeeded"}'const res = await fetch("https://api.warilo.com/v1/sandbox/payments/pay_3f2a9c0d1e4b5a6f7c8d/confirm", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.WARILO_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"outcome": "succeeded"
})
});
const data = await res.json();import os, requests
r = requests.post(
"https://api.warilo.com/v1/sandbox/payments/pay_3f2a9c0d1e4b5a6f7c8d/confirm",
headers={"Authorization": f"Bearer {os.environ['WARILO_KEY']}"},
json={
"outcome": "succeeded"
},
)
print(r.status_code, r.json())$ch = curl_init("https://api.warilo.com/v1/sandbox/payments/pay_3f2a9c0d1e4b5a6f7c8d/confirm");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("WARILO_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode(json_decode('{"outcome": "succeeded"}')),
]);
$data = json_decode(curl_exec($ch), true);import java.net.URI;
import java.net.http.*;
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder(URI.create("https://api.warilo.com/v1/sandbox/payments/pay_3f2a9c0d1e4b5a6f7c8d/confirm"))
.method("POST", HttpRequest.BodyPublishers.ofString("{\"outcome\": \"succeeded\"}"))
.header("Authorization", "Bearer " + System.getenv("WARILO_KEY"))
.header("Content-Type", "application/json")
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.warilo.com/v1/sandbox/payments/pay_3f2a9c0d1e4b5a6f7c8d/confirm");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("WARILO_KEY"));
request.Content = new StringContent("{\"outcome\": \"succeeded\"}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{"outcome": "succeeded"}`)
req, _ := http.NewRequest("POST", "https://api.warilo.com/v1/sandbox/payments/pay_3f2a9c0d1e4b5a6f7c8d/confirm", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("WARILO_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
fmt.Println(res.Status, string(data))
}require "net/http"
require "json"
require "uri"
uri = URI("https://api.warilo.com/v1/sandbox/payments/pay_3f2a9c0d1e4b5a6f7c8d/confirm")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV['WARILO_KEY']}"
req["Content-Type"] = "application/json"
req.body = "{\"outcome\": \"succeeded\"}"
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
puts "#{res.code} #{res.body}"Response 200
{
"id": "pay_3f2a9c0d1e4b5a6f7c8d",
"object": "payment",
"status": "succeeded",
"amount": 12000,
"currency": "EUR",
"method": "mobile_money",
"operator": "orange_money",
"customer": {
"phone": "+237673713115",
"name": "Awa Ngo"
},
"description": "Tuition, first term",
"checkout_url": null,
"refunded_amount": 0,
"failure_code": null,
"livemode": false,
"created_at": "2026-10-28T09:15:00Z",
"expires_at": "2026-10-28T09:20:00Z"
}Test and integrate
Test console
Enter your test key (wk_test_…). It stays in this page: it is neither stored nor sent anywhere but to the API.
Files and tools
Download the OpenAPI specification to generate a client in your language, or import the collection into Postman, Bruno or Insomnia.
Start collecting today
Get your test and live keys, and support for your integration.
