Callback Payment
curl --request POST \
--url https://your.endpoint.to.notify/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://your.endpoint.to.notify/"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://your.endpoint.to.notify/', 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://your.endpoint.to.notify/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://your.endpoint.to.notify/"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://your.endpoint.to.notify/")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://your.endpoint.to.notify/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": 123,
"invoice": "<string>",
"end_to_end": "<string>",
"status": {
"id": 123,
"name": "<string>"
},
"updated_at": "<string>",
"status_detail": {
"code": "<string>",
"detail": "<string>"
}
}Callback Payment
Receive updates about your payout
POST
/
Callback Payment
curl --request POST \
--url https://your.endpoint.to.notify/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://your.endpoint.to.notify/"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://your.endpoint.to.notify/', 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://your.endpoint.to.notify/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://your.endpoint.to.notify/"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://your.endpoint.to.notify/")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://your.endpoint.to.notify/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": 123,
"invoice": "<string>",
"end_to_end": "<string>",
"status": {
"id": 123,
"name": "<string>"
},
"updated_at": "<string>",
"status_detail": {
"code": "<string>",
"detail": "<string>"
}
}Callbacks
Receive updates about your payout.Payout
Endpoint:
POST https://your.endpoint.to.notifyThis is your endpoint where WEpayments will send notifications about payout status changes.Response
You should respond with 200 OK to acknowledge receipt of the webhook.Body
The webhook payload contains the following fields:integer
Payout IDExample:
2322977string
Payout invoiceExample:
575e8327-f145-48ff-b207-737eef2d6f3fstring
Payout end-to-endExample:
END-TO-END-IDobject
string
Last update of your payout.Format:
<date-time>Example: 2024-09-25 15:55:18object
This object is returned when the payout is canceled (status
6). It provides more details on the reason for the cancellation. See Rejection Reasons for the list of codes.Webhook Payload Example
{
"id": 2322977,
"invoice": "575e8327-f145-48ff-b207-737eef2d6f3f",
"status": {
"id": 6,
"name": "Canceled"
},
"updated_at": "2024-09-25 15:55:18",
"status_detail": {
"code": "WE0001",
"detail": "The payment was made to an unregistered account"
}
}
Status Codes
Common payout status codes:| Status ID | Status Name | Description |
|---|---|---|
| 7 | Awaiting | Payout has been created and is waiting to be processed |
| 1 | Received | Payout has been received |
| 2 | Processing | Payout is being processed |
| 5 | In Review | Payout is under compliance review |
| 8 | Processed | Payout was sent and is waiting for confirmation |
| 3 | Paid | Payout has been paid successfully |
| 4 | Rejected | Payout was rejected by the bank (TED only) |
| 6 | Canceled | Payout was canceled. See status_detail for the reason |
| 11 | Invalid data input | Data provided is invalid or insufficient |
Best Practices
Always Respond 200 OK: Your endpoint must respond with HTTP 200 to acknowledge receipt. Otherwise, WEpayments will retry sending the webhook.
Validate Webhook Signature: In production, always validate the webhook signature to ensure it’s from WEpayments. Register a webhook
secret to receive the recommended HMAC-SHA256 signature in the x-webhook-wp-signature header — the API key based signature is deprecated. See Webhook Signature Documentation for details.Process Asynchronously: Handle webhook processing asynchronously to respond quickly and avoid timeouts.
If the API returns a Canceled, Failed, or Rejected status, a new invoice must be generated. These statuses indicate that the record has already been processed and persisted in our database, preventing any modifications or retries using the same identifier.
Re-submission Policy:
INVALID_DATA: You may resubmit the same payload in a new request only if the payment status is INVALID_DATA. This status occurs when banking details are incorrect (provided validation is enabled for the merchant).
Other Statuses: All other statuses will trigger a duplication block if an invoice with the same data already exists.
Related Resources
Create Payment
Create a payout payment
Webhook Signature
Validate webhook signatures
Was this page helpful?

