payment.succeeded
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
event: 'payment.succeeded',
timestamp: '2024-01-15T10:30:00Z',
order: {
id: '550e8400-e29b-41d4-a716-446655440000',
reference: 'ORD-2024-001',
customer_email: '[email protected]',
amount: 15000,
currency: 'USD'
},
payment: {
status: 'paid',
amount: 15000,
currency: 'USD',
paid_at: '2024-01-15T10:30:00Z'
}
})
};
fetch('https://api.traddal.com/webhooks/payment.succeeded', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.traddal.com/webhooks/payment.succeeded"
payload = {
"event": "payment.succeeded",
"timestamp": "2024-01-15T10:30:00Z",
"order": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"reference": "ORD-2024-001",
"customer_email": "[email protected]",
"amount": 15000,
"currency": "USD"
},
"payment": {
"status": "paid",
"amount": 15000,
"currency": "USD",
"paid_at": "2024-01-15T10:30:00Z"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.traddal.com/webhooks/payment.succeeded",
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([
'event' => 'payment.succeeded',
'timestamp' => '2024-01-15T10:30:00Z',
'order' => [
'id' => '550e8400-e29b-41d4-a716-446655440000',
'reference' => 'ORD-2024-001',
'customer_email' => '[email protected]',
'amount' => 15000,
'currency' => 'USD'
],
'payment' => [
'status' => 'paid',
'amount' => 15000,
'currency' => 'USD',
'paid_at' => '2024-01-15T10:30:00Z'
]
]),
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.traddal.com/webhooks/payment.succeeded"
payload := strings.NewReader("{\n \"event\": \"payment.succeeded\",\n \"timestamp\": \"2024-01-15T10:30:00Z\",\n \"order\": {\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"reference\": \"ORD-2024-001\",\n \"customer_email\": \"[email protected]\",\n \"amount\": 15000,\n \"currency\": \"USD\"\n },\n \"payment\": {\n \"status\": \"paid\",\n \"amount\": 15000,\n \"currency\": \"USD\",\n \"paid_at\": \"2024-01-15T10:30:00Z\"\n }\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.traddal.com/webhooks/payment.succeeded")
.header("Content-Type", "application/json")
.body("{\n \"event\": \"payment.succeeded\",\n \"timestamp\": \"2024-01-15T10:30:00Z\",\n \"order\": {\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"reference\": \"ORD-2024-001\",\n \"customer_email\": \"[email protected]\",\n \"amount\": 15000,\n \"currency\": \"USD\"\n },\n \"payment\": {\n \"status\": \"paid\",\n \"amount\": 15000,\n \"currency\": \"USD\",\n \"paid_at\": \"2024-01-15T10:30:00Z\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.traddal.com/webhooks/payment.succeeded")
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 \"event\": \"payment.succeeded\",\n \"timestamp\": \"2024-01-15T10:30:00Z\",\n \"order\": {\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"reference\": \"ORD-2024-001\",\n \"customer_email\": \"[email protected]\",\n \"amount\": 15000,\n \"currency\": \"USD\"\n },\n \"payment\": {\n \"status\": \"paid\",\n \"amount\": 15000,\n \"currency\": \"USD\",\n \"paid_at\": \"2024-01-15T10:30:00Z\"\n }\n}"
response = http.request(request)
puts response.read_bodycurl --request POST \
--url https://api.traddal.com/webhooks/payment.succeeded \
--header 'Content-Type: application/json' \
--data '
{
"event": "payment.succeeded",
"timestamp": "2024-01-15T10:30:00Z",
"order": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"reference": "ORD-2024-001",
"customer_email": "[email protected]",
"amount": 15000,
"currency": "USD"
},
"payment": {
"status": "paid",
"amount": 15000,
"currency": "USD",
"paid_at": "2024-01-15T10:30:00Z"
}
}
'{
"received": true
}Webhooks
payment.succeeded
Sent when a payment is successfully completed via Stripe.
Headers:
Content-Type: application/jsonUser-Agent: Traddal-Webhooks/1.0X-Traddal-Event: payment.succeededX-Traddal-Signature: <hmac_sha256_signature>(if webhook secret configured)
POST
/
webhooks
/
payment.succeeded
payment.succeeded
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
event: 'payment.succeeded',
timestamp: '2024-01-15T10:30:00Z',
order: {
id: '550e8400-e29b-41d4-a716-446655440000',
reference: 'ORD-2024-001',
customer_email: '[email protected]',
amount: 15000,
currency: 'USD'
},
payment: {
status: 'paid',
amount: 15000,
currency: 'USD',
paid_at: '2024-01-15T10:30:00Z'
}
})
};
fetch('https://api.traddal.com/webhooks/payment.succeeded', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.traddal.com/webhooks/payment.succeeded"
payload = {
"event": "payment.succeeded",
"timestamp": "2024-01-15T10:30:00Z",
"order": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"reference": "ORD-2024-001",
"customer_email": "[email protected]",
"amount": 15000,
"currency": "USD"
},
"payment": {
"status": "paid",
"amount": 15000,
"currency": "USD",
"paid_at": "2024-01-15T10:30:00Z"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.traddal.com/webhooks/payment.succeeded",
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([
'event' => 'payment.succeeded',
'timestamp' => '2024-01-15T10:30:00Z',
'order' => [
'id' => '550e8400-e29b-41d4-a716-446655440000',
'reference' => 'ORD-2024-001',
'customer_email' => '[email protected]',
'amount' => 15000,
'currency' => 'USD'
],
'payment' => [
'status' => 'paid',
'amount' => 15000,
'currency' => 'USD',
'paid_at' => '2024-01-15T10:30:00Z'
]
]),
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.traddal.com/webhooks/payment.succeeded"
payload := strings.NewReader("{\n \"event\": \"payment.succeeded\",\n \"timestamp\": \"2024-01-15T10:30:00Z\",\n \"order\": {\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"reference\": \"ORD-2024-001\",\n \"customer_email\": \"[email protected]\",\n \"amount\": 15000,\n \"currency\": \"USD\"\n },\n \"payment\": {\n \"status\": \"paid\",\n \"amount\": 15000,\n \"currency\": \"USD\",\n \"paid_at\": \"2024-01-15T10:30:00Z\"\n }\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.traddal.com/webhooks/payment.succeeded")
.header("Content-Type", "application/json")
.body("{\n \"event\": \"payment.succeeded\",\n \"timestamp\": \"2024-01-15T10:30:00Z\",\n \"order\": {\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"reference\": \"ORD-2024-001\",\n \"customer_email\": \"[email protected]\",\n \"amount\": 15000,\n \"currency\": \"USD\"\n },\n \"payment\": {\n \"status\": \"paid\",\n \"amount\": 15000,\n \"currency\": \"USD\",\n \"paid_at\": \"2024-01-15T10:30:00Z\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.traddal.com/webhooks/payment.succeeded")
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 \"event\": \"payment.succeeded\",\n \"timestamp\": \"2024-01-15T10:30:00Z\",\n \"order\": {\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"reference\": \"ORD-2024-001\",\n \"customer_email\": \"[email protected]\",\n \"amount\": 15000,\n \"currency\": \"USD\"\n },\n \"payment\": {\n \"status\": \"paid\",\n \"amount\": 15000,\n \"currency\": \"USD\",\n \"paid_at\": \"2024-01-15T10:30:00Z\"\n }\n}"
response = http.request(request)
puts response.read_bodycurl --request POST \
--url https://api.traddal.com/webhooks/payment.succeeded \
--header 'Content-Type: application/json' \
--data '
{
"event": "payment.succeeded",
"timestamp": "2024-01-15T10:30:00Z",
"order": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"reference": "ORD-2024-001",
"customer_email": "[email protected]",
"amount": 15000,
"currency": "USD"
},
"payment": {
"status": "paid",
"amount": 15000,
"currency": "USD",
"paid_at": "2024-01-15T10:30:00Z"
}
}
'{
"received": true
}Body
application/json
Response
200 - application/json
Webhook received successfully
Example:
true