Transaction Webhooks
curl --request POST \
--url https://merchant-url.com/api/webhooks_transaction \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"type": "pending",
"object": "transaction",
"data": {
"id": "T1c3p4yBuVYJ9",
"type": "cc_payment",
"processor": "adyen_gateway",
"date": 1615407159447,
"reference": "LBLJ-TWW7-R9VC",
"status": "cancelled",
"from_user": {
"id": "T1c3p4yBuVYJ9",
"first_name": "Charlotte",
"last_name": "Charles",
"phones": [
[
{
"id": "123",
"number": "867-5309",
"country_code": "1",
"status": "active",
"priority": "primary"
}
]
],
"emails": [
{
"id": "123",
"address": "my.email@gmail.com",
"status": "active",
"priority": "primary"
}
]
},
"from_credit_card": {
"id": "AB3rJKam5DhYE",
"last4": "4021",
"network": "Visa",
"display_network": "Visa"
},
"order": {
"token": "a2b3dDc4cA5e6fg78Bg9hj0kl",
"user_note": "This item is a gift.",
"external_data": {
"shopify": "VIP shopper"
},
"dynamic_content": {
"shipping_info_notice": "A Notice Message",
"payment_notice": "A Notice Message",
"shipping_notice": "A Notice Message",
"order_notice": "A Notice Message",
"custom_fields": [
{
"external_id": "123456",
"public_id": "i-123456",
"label": "Special Field",
"field_setup": "string",
"checkout_setup": "string",
"position": 1,
"required": true,
"dynamic": false,
"subscribe_to_newsletter": false
}
],
"hide_apm": [],
"gift_option_view": {
"hide_gift_wrap": false,
"hide_gift_message": false
}
}
},
"captures": [
{
"id": "BcDE4fafd2a4",
"status": "succeeded",
"amount": {
"amount": 754,
"currency": "USD",
"currency_symbol": "$"
},
"splits": [
{
"amount": {
"amount": 754,
"currency": "USD",
"currency_symbol": "$"
},
"type": "processing_fee"
}
]
}
],
"refund_transactions": [
{
"id": "T1c3p4yBuVYJ9",
"type": "cc_payment",
"processor": "adyen_gateway",
"date": 1615407159447,
"reference": "LBLJ-TWW7-R9VC",
"status": "cancelled",
"captures": [
{
"id": "BcDE4fafd2a4",
"status": "succeeded",
"amount": {
"amount": 754,
"currency": "USD",
"currency_symbol": "$"
},
"splits": [
{
"amount": {
"amount": 754,
"currency": "USD",
"currency_symbol": "$"
},
"type": "processing_fee"
}
]
}
],
"credit": {},
"transaction_properties": {
"avs_result": "avs result",
"cvv_result": "cvv result"
},
"indemnification_decision": "indemnified",
"indemnification_reason": "checkout",
"last_viewed_utc": 1485997169003,
"last4": "4021",
"risk_insights": {
"available": true,
"fraud_probability": 943,
"decision_factors": [
"checkout_behavior"
],
"payment_instrument_factors": {
"avs": "avs result",
"cvv": "cvv result"
}
},
"order_decision": {
"score": "680",
"decision_factors": [
"checkout_behavior"
]
},
"merchant_order_number": "O-1234567",
"splits": [
{
"amount": {
"amount": 754,
"currency": "USD",
"currency_symbol": "$"
},
"type": "processing_fee"
}
],
"review_ticket": {
"id": "2d34a56",
"status": "reviewed",
"request_deadline": 1627955971268
}
}
],
"risk_signals": {
"ip_address": "147.92.88.21",
"time_on_site": "00:08:42",
"http_headers": {
"accept": "application/json",
"accept_encoding": "gzip, deflate, br",
"accept_language": "en-US,en;q=0.9",
"connection": null,
"host": "api-staging.boltapp.com",
"referer": "https://merchant-staging.boltapp.com/",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36"
}
}
}
}
'import requests
url = "https://merchant-url.com/api/webhooks_transaction"
payload = {
"type": "pending",
"object": "transaction",
"data": {
"id": "T1c3p4yBuVYJ9",
"type": "cc_payment",
"processor": "adyen_gateway",
"date": 1615407159447,
"reference": "LBLJ-TWW7-R9VC",
"status": "cancelled",
"from_user": {
"id": "T1c3p4yBuVYJ9",
"first_name": "Charlotte",
"last_name": "Charles",
"phones": [[
{
"id": "123",
"number": "867-5309",
"country_code": "1",
"status": "active",
"priority": "primary"
}
]],
"emails": [
{
"id": "123",
"address": "my.email@gmail.com",
"status": "active",
"priority": "primary"
}
]
},
"from_credit_card": {
"id": "AB3rJKam5DhYE",
"last4": "4021",
"network": "Visa",
"display_network": "Visa"
},
"order": {
"token": "a2b3dDc4cA5e6fg78Bg9hj0kl",
"user_note": "This item is a gift.",
"external_data": { "shopify": "VIP shopper" },
"dynamic_content": {
"shipping_info_notice": "A Notice Message",
"payment_notice": "A Notice Message",
"shipping_notice": "A Notice Message",
"order_notice": "A Notice Message",
"custom_fields": [
{
"external_id": "123456",
"public_id": "i-123456",
"label": "Special Field",
"field_setup": "string",
"checkout_setup": "string",
"position": 1,
"required": True,
"dynamic": False,
"subscribe_to_newsletter": False
}
],
"hide_apm": [],
"gift_option_view": {
"hide_gift_wrap": False,
"hide_gift_message": False
}
}
},
"captures": [
{
"id": "BcDE4fafd2a4",
"status": "succeeded",
"amount": {
"amount": 754,
"currency": "USD",
"currency_symbol": "$"
},
"splits": [
{
"amount": {
"amount": 754,
"currency": "USD",
"currency_symbol": "$"
},
"type": "processing_fee"
}
]
}
],
"refund_transactions": [
{
"id": "T1c3p4yBuVYJ9",
"type": "cc_payment",
"processor": "adyen_gateway",
"date": 1615407159447,
"reference": "LBLJ-TWW7-R9VC",
"status": "cancelled",
"captures": [
{
"id": "BcDE4fafd2a4",
"status": "succeeded",
"amount": {
"amount": 754,
"currency": "USD",
"currency_symbol": "$"
},
"splits": [
{
"amount": {
"amount": 754,
"currency": "USD",
"currency_symbol": "$"
},
"type": "processing_fee"
}
]
}
],
"credit": {},
"transaction_properties": {
"avs_result": "avs result",
"cvv_result": "cvv result"
},
"indemnification_decision": "indemnified",
"indemnification_reason": "checkout",
"last_viewed_utc": 1485997169003,
"last4": "4021",
"risk_insights": {
"available": True,
"fraud_probability": 943,
"decision_factors": ["checkout_behavior"],
"payment_instrument_factors": {
"avs": "avs result",
"cvv": "cvv result"
}
},
"order_decision": {
"score": "680",
"decision_factors": ["checkout_behavior"]
},
"merchant_order_number": "O-1234567",
"splits": [
{
"amount": {
"amount": 754,
"currency": "USD",
"currency_symbol": "$"
},
"type": "processing_fee"
}
],
"review_ticket": {
"id": "2d34a56",
"status": "reviewed",
"request_deadline": 1627955971268
}
}
],
"risk_signals": {
"ip_address": "147.92.88.21",
"time_on_site": "00:08:42",
"http_headers": {
"accept": "application/json",
"accept_encoding": "gzip, deflate, br",
"accept_language": "en-US,en;q=0.9",
"connection": None,
"host": "api-staging.boltapp.com",
"referer": "https://merchant-staging.boltapp.com/",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36"
}
}
}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'pending',
object: 'transaction',
data: {
id: 'T1c3p4yBuVYJ9',
type: 'cc_payment',
processor: 'adyen_gateway',
date: 1615407159447,
reference: 'LBLJ-TWW7-R9VC',
status: 'cancelled',
from_user: {
id: 'T1c3p4yBuVYJ9',
first_name: 'Charlotte',
last_name: 'Charles',
phones: [
[
{
id: '123',
number: '867-5309',
country_code: '1',
status: 'active',
priority: 'primary'
}
]
],
emails: [
{
id: '123',
address: 'my.email@gmail.com',
status: 'active',
priority: 'primary'
}
]
},
from_credit_card: {id: 'AB3rJKam5DhYE', last4: '4021', network: 'Visa', display_network: 'Visa'},
order: {
token: 'a2b3dDc4cA5e6fg78Bg9hj0kl',
user_note: 'This item is a gift.',
external_data: {shopify: 'VIP shopper'},
dynamic_content: {
shipping_info_notice: 'A Notice Message',
payment_notice: 'A Notice Message',
shipping_notice: 'A Notice Message',
order_notice: 'A Notice Message',
custom_fields: [
{
external_id: '123456',
public_id: 'i-123456',
label: 'Special Field',
field_setup: 'string',
checkout_setup: 'string',
position: 1,
required: true,
dynamic: false,
subscribe_to_newsletter: false
}
],
hide_apm: [],
gift_option_view: {hide_gift_wrap: false, hide_gift_message: false}
}
},
captures: [
{
id: 'BcDE4fafd2a4',
status: 'succeeded',
amount: {amount: 754, currency: 'USD', currency_symbol: '$'},
splits: [
{
amount: {amount: 754, currency: 'USD', currency_symbol: '$'},
type: 'processing_fee'
}
]
}
],
refund_transactions: [
{
id: 'T1c3p4yBuVYJ9',
type: 'cc_payment',
processor: 'adyen_gateway',
date: 1615407159447,
reference: 'LBLJ-TWW7-R9VC',
status: 'cancelled',
captures: [
{
id: 'BcDE4fafd2a4',
status: 'succeeded',
amount: {amount: 754, currency: 'USD', currency_symbol: '$'},
splits: [
{
amount: {amount: 754, currency: 'USD', currency_symbol: '$'},
type: 'processing_fee'
}
]
}
],
credit: {},
transaction_properties: {avs_result: 'avs result', cvv_result: 'cvv result'},
indemnification_decision: 'indemnified',
indemnification_reason: 'checkout',
last_viewed_utc: 1485997169003,
last4: '4021',
risk_insights: {
available: true,
fraud_probability: 943,
decision_factors: ['checkout_behavior'],
payment_instrument_factors: {avs: 'avs result', cvv: 'cvv result'}
},
order_decision: {score: '680', decision_factors: ['checkout_behavior']},
merchant_order_number: 'O-1234567',
splits: [
{
amount: {amount: 754, currency: 'USD', currency_symbol: '$'},
type: 'processing_fee'
}
],
review_ticket: {id: '2d34a56', status: 'reviewed', request_deadline: 1627955971268}
}
],
risk_signals: {
ip_address: '147.92.88.21',
time_on_site: '00:08:42',
http_headers: {
accept: 'application/json',
accept_encoding: 'gzip, deflate, br',
accept_language: 'en-US,en;q=0.9',
connection: null,
host: 'api-staging.boltapp.com',
referer: 'https://merchant-staging.boltapp.com/',
user_agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36'
}
}
}
})
};
fetch('https://merchant-url.com/api/webhooks_transaction', 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://merchant-url.com/api/webhooks_transaction",
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([
'type' => 'pending',
'object' => 'transaction',
'data' => [
'id' => 'T1c3p4yBuVYJ9',
'type' => 'cc_payment',
'processor' => 'adyen_gateway',
'date' => 1615407159447,
'reference' => 'LBLJ-TWW7-R9VC',
'status' => 'cancelled',
'from_user' => [
'id' => 'T1c3p4yBuVYJ9',
'first_name' => 'Charlotte',
'last_name' => 'Charles',
'phones' => [
[
[
'id' => '123',
'number' => '867-5309',
'country_code' => '1',
'status' => 'active',
'priority' => 'primary'
]
]
],
'emails' => [
[
'id' => '123',
'address' => 'my.email@gmail.com',
'status' => 'active',
'priority' => 'primary'
]
]
],
'from_credit_card' => [
'id' => 'AB3rJKam5DhYE',
'last4' => '4021',
'network' => 'Visa',
'display_network' => 'Visa'
],
'order' => [
'token' => 'a2b3dDc4cA5e6fg78Bg9hj0kl',
'user_note' => 'This item is a gift.',
'external_data' => [
'shopify' => 'VIP shopper'
],
'dynamic_content' => [
'shipping_info_notice' => 'A Notice Message',
'payment_notice' => 'A Notice Message',
'shipping_notice' => 'A Notice Message',
'order_notice' => 'A Notice Message',
'custom_fields' => [
[
'external_id' => '123456',
'public_id' => 'i-123456',
'label' => 'Special Field',
'field_setup' => 'string',
'checkout_setup' => 'string',
'position' => 1,
'required' => true,
'dynamic' => false,
'subscribe_to_newsletter' => false
]
],
'hide_apm' => [
],
'gift_option_view' => [
'hide_gift_wrap' => false,
'hide_gift_message' => false
]
]
],
'captures' => [
[
'id' => 'BcDE4fafd2a4',
'status' => 'succeeded',
'amount' => [
'amount' => 754,
'currency' => 'USD',
'currency_symbol' => '$'
],
'splits' => [
[
'amount' => [
'amount' => 754,
'currency' => 'USD',
'currency_symbol' => '$'
],
'type' => 'processing_fee'
]
]
]
],
'refund_transactions' => [
[
'id' => 'T1c3p4yBuVYJ9',
'type' => 'cc_payment',
'processor' => 'adyen_gateway',
'date' => 1615407159447,
'reference' => 'LBLJ-TWW7-R9VC',
'status' => 'cancelled',
'captures' => [
[
'id' => 'BcDE4fafd2a4',
'status' => 'succeeded',
'amount' => [
'amount' => 754,
'currency' => 'USD',
'currency_symbol' => '$'
],
'splits' => [
[
'amount' => [
'amount' => 754,
'currency' => 'USD',
'currency_symbol' => '$'
],
'type' => 'processing_fee'
]
]
]
],
'credit' => [
],
'transaction_properties' => [
'avs_result' => 'avs result',
'cvv_result' => 'cvv result'
],
'indemnification_decision' => 'indemnified',
'indemnification_reason' => 'checkout',
'last_viewed_utc' => 1485997169003,
'last4' => '4021',
'risk_insights' => [
'available' => true,
'fraud_probability' => 943,
'decision_factors' => [
'checkout_behavior'
],
'payment_instrument_factors' => [
'avs' => 'avs result',
'cvv' => 'cvv result'
]
],
'order_decision' => [
'score' => '680',
'decision_factors' => [
'checkout_behavior'
]
],
'merchant_order_number' => 'O-1234567',
'splits' => [
[
'amount' => [
'amount' => 754,
'currency' => 'USD',
'currency_symbol' => '$'
],
'type' => 'processing_fee'
]
],
'review_ticket' => [
'id' => '2d34a56',
'status' => 'reviewed',
'request_deadline' => 1627955971268
]
]
],
'risk_signals' => [
'ip_address' => '147.92.88.21',
'time_on_site' => '00:08:42',
'http_headers' => [
'accept' => 'application/json',
'accept_encoding' => 'gzip, deflate, br',
'accept_language' => 'en-US,en;q=0.9',
'connection' => null,
'host' => 'api-staging.boltapp.com',
'referer' => 'https://merchant-staging.boltapp.com/',
'user_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://merchant-url.com/api/webhooks_transaction"
payload := strings.NewReader("{\n \"type\": \"pending\",\n \"object\": \"transaction\",\n \"data\": {\n \"id\": \"T1c3p4yBuVYJ9\",\n \"type\": \"cc_payment\",\n \"processor\": \"adyen_gateway\",\n \"date\": 1615407159447,\n \"reference\": \"LBLJ-TWW7-R9VC\",\n \"status\": \"cancelled\",\n \"from_user\": {\n \"id\": \"T1c3p4yBuVYJ9\",\n \"first_name\": \"Charlotte\",\n \"last_name\": \"Charles\",\n \"phones\": [\n [\n {\n \"id\": \"123\",\n \"number\": \"867-5309\",\n \"country_code\": \"1\",\n \"status\": \"active\",\n \"priority\": \"primary\"\n }\n ]\n ],\n \"emails\": [\n {\n \"id\": \"123\",\n \"address\": \"my.email@gmail.com\",\n \"status\": \"active\",\n \"priority\": \"primary\"\n }\n ]\n },\n \"from_credit_card\": {\n \"id\": \"AB3rJKam5DhYE\",\n \"last4\": \"4021\",\n \"network\": \"Visa\",\n \"display_network\": \"Visa\"\n },\n \"order\": {\n \"token\": \"a2b3dDc4cA5e6fg78Bg9hj0kl\",\n \"user_note\": \"This item is a gift.\",\n \"external_data\": {\n \"shopify\": \"VIP shopper\"\n },\n \"dynamic_content\": {\n \"shipping_info_notice\": \"A Notice Message\",\n \"payment_notice\": \"A Notice Message\",\n \"shipping_notice\": \"A Notice Message\",\n \"order_notice\": \"A Notice Message\",\n \"custom_fields\": [\n {\n \"external_id\": \"123456\",\n \"public_id\": \"i-123456\",\n \"label\": \"Special Field\",\n \"field_setup\": \"string\",\n \"checkout_setup\": \"string\",\n \"position\": 1,\n \"required\": true,\n \"dynamic\": false,\n \"subscribe_to_newsletter\": false\n }\n ],\n \"hide_apm\": [],\n \"gift_option_view\": {\n \"hide_gift_wrap\": false,\n \"hide_gift_message\": false\n }\n }\n },\n \"captures\": [\n {\n \"id\": \"BcDE4fafd2a4\",\n \"status\": \"succeeded\",\n \"amount\": {\n \"amount\": 754,\n \"currency\": \"USD\",\n \"currency_symbol\": \"$\"\n },\n \"splits\": [\n {\n \"amount\": {\n \"amount\": 754,\n \"currency\": \"USD\",\n \"currency_symbol\": \"$\"\n },\n \"type\": \"processing_fee\"\n }\n ]\n }\n ],\n \"refund_transactions\": [\n {\n \"id\": \"T1c3p4yBuVYJ9\",\n \"type\": \"cc_payment\",\n \"processor\": \"adyen_gateway\",\n \"date\": 1615407159447,\n \"reference\": \"LBLJ-TWW7-R9VC\",\n \"status\": \"cancelled\",\n \"captures\": [\n {\n \"id\": \"BcDE4fafd2a4\",\n \"status\": \"succeeded\",\n \"amount\": {\n \"amount\": 754,\n \"currency\": \"USD\",\n \"currency_symbol\": \"$\"\n },\n \"splits\": [\n {\n \"amount\": {\n \"amount\": 754,\n \"currency\": \"USD\",\n \"currency_symbol\": \"$\"\n },\n \"type\": \"processing_fee\"\n }\n ]\n }\n ],\n \"credit\": {},\n \"transaction_properties\": {\n \"avs_result\": \"avs result\",\n \"cvv_result\": \"cvv result\"\n },\n \"indemnification_decision\": \"indemnified\",\n \"indemnification_reason\": \"checkout\",\n \"last_viewed_utc\": 1485997169003,\n \"last4\": \"4021\",\n \"risk_insights\": {\n \"available\": true,\n \"fraud_probability\": 943,\n \"decision_factors\": [\n \"checkout_behavior\"\n ],\n \"payment_instrument_factors\": {\n \"avs\": \"avs result\",\n \"cvv\": \"cvv result\"\n }\n },\n \"order_decision\": {\n \"score\": \"680\",\n \"decision_factors\": [\n \"checkout_behavior\"\n ]\n },\n \"merchant_order_number\": \"O-1234567\",\n \"splits\": [\n {\n \"amount\": {\n \"amount\": 754,\n \"currency\": \"USD\",\n \"currency_symbol\": \"$\"\n },\n \"type\": \"processing_fee\"\n }\n ],\n \"review_ticket\": {\n \"id\": \"2d34a56\",\n \"status\": \"reviewed\",\n \"request_deadline\": 1627955971268\n }\n }\n ],\n \"risk_signals\": {\n \"ip_address\": \"147.92.88.21\",\n \"time_on_site\": \"00:08:42\",\n \"http_headers\": {\n \"accept\": \"application/json\",\n \"accept_encoding\": \"gzip, deflate, br\",\n \"accept_language\": \"en-US,en;q=0.9\",\n \"connection\": null,\n \"host\": \"api-staging.boltapp.com\",\n \"referer\": \"https://merchant-staging.boltapp.com/\",\n \"user_agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36\"\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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://merchant-url.com/api/webhooks_transaction")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"pending\",\n \"object\": \"transaction\",\n \"data\": {\n \"id\": \"T1c3p4yBuVYJ9\",\n \"type\": \"cc_payment\",\n \"processor\": \"adyen_gateway\",\n \"date\": 1615407159447,\n \"reference\": \"LBLJ-TWW7-R9VC\",\n \"status\": \"cancelled\",\n \"from_user\": {\n \"id\": \"T1c3p4yBuVYJ9\",\n \"first_name\": \"Charlotte\",\n \"last_name\": \"Charles\",\n \"phones\": [\n [\n {\n \"id\": \"123\",\n \"number\": \"867-5309\",\n \"country_code\": \"1\",\n \"status\": \"active\",\n \"priority\": \"primary\"\n }\n ]\n ],\n \"emails\": [\n {\n \"id\": \"123\",\n \"address\": \"my.email@gmail.com\",\n \"status\": \"active\",\n \"priority\": \"primary\"\n }\n ]\n },\n \"from_credit_card\": {\n \"id\": \"AB3rJKam5DhYE\",\n \"last4\": \"4021\",\n \"network\": \"Visa\",\n \"display_network\": \"Visa\"\n },\n \"order\": {\n \"token\": \"a2b3dDc4cA5e6fg78Bg9hj0kl\",\n \"user_note\": \"This item is a gift.\",\n \"external_data\": {\n \"shopify\": \"VIP shopper\"\n },\n \"dynamic_content\": {\n \"shipping_info_notice\": \"A Notice Message\",\n \"payment_notice\": \"A Notice Message\",\n \"shipping_notice\": \"A Notice Message\",\n \"order_notice\": \"A Notice Message\",\n \"custom_fields\": [\n {\n \"external_id\": \"123456\",\n \"public_id\": \"i-123456\",\n \"label\": \"Special Field\",\n \"field_setup\": \"string\",\n \"checkout_setup\": \"string\",\n \"position\": 1,\n \"required\": true,\n \"dynamic\": false,\n \"subscribe_to_newsletter\": false\n }\n ],\n \"hide_apm\": [],\n \"gift_option_view\": {\n \"hide_gift_wrap\": false,\n \"hide_gift_message\": false\n }\n }\n },\n \"captures\": [\n {\n \"id\": \"BcDE4fafd2a4\",\n \"status\": \"succeeded\",\n \"amount\": {\n \"amount\": 754,\n \"currency\": \"USD\",\n \"currency_symbol\": \"$\"\n },\n \"splits\": [\n {\n \"amount\": {\n \"amount\": 754,\n \"currency\": \"USD\",\n \"currency_symbol\": \"$\"\n },\n \"type\": \"processing_fee\"\n }\n ]\n }\n ],\n \"refund_transactions\": [\n {\n \"id\": \"T1c3p4yBuVYJ9\",\n \"type\": \"cc_payment\",\n \"processor\": \"adyen_gateway\",\n \"date\": 1615407159447,\n \"reference\": \"LBLJ-TWW7-R9VC\",\n \"status\": \"cancelled\",\n \"captures\": [\n {\n \"id\": \"BcDE4fafd2a4\",\n \"status\": \"succeeded\",\n \"amount\": {\n \"amount\": 754,\n \"currency\": \"USD\",\n \"currency_symbol\": \"$\"\n },\n \"splits\": [\n {\n \"amount\": {\n \"amount\": 754,\n \"currency\": \"USD\",\n \"currency_symbol\": \"$\"\n },\n \"type\": \"processing_fee\"\n }\n ]\n }\n ],\n \"credit\": {},\n \"transaction_properties\": {\n \"avs_result\": \"avs result\",\n \"cvv_result\": \"cvv result\"\n },\n \"indemnification_decision\": \"indemnified\",\n \"indemnification_reason\": \"checkout\",\n \"last_viewed_utc\": 1485997169003,\n \"last4\": \"4021\",\n \"risk_insights\": {\n \"available\": true,\n \"fraud_probability\": 943,\n \"decision_factors\": [\n \"checkout_behavior\"\n ],\n \"payment_instrument_factors\": {\n \"avs\": \"avs result\",\n \"cvv\": \"cvv result\"\n }\n },\n \"order_decision\": {\n \"score\": \"680\",\n \"decision_factors\": [\n \"checkout_behavior\"\n ]\n },\n \"merchant_order_number\": \"O-1234567\",\n \"splits\": [\n {\n \"amount\": {\n \"amount\": 754,\n \"currency\": \"USD\",\n \"currency_symbol\": \"$\"\n },\n \"type\": \"processing_fee\"\n }\n ],\n \"review_ticket\": {\n \"id\": \"2d34a56\",\n \"status\": \"reviewed\",\n \"request_deadline\": 1627955971268\n }\n }\n ],\n \"risk_signals\": {\n \"ip_address\": \"147.92.88.21\",\n \"time_on_site\": \"00:08:42\",\n \"http_headers\": {\n \"accept\": \"application/json\",\n \"accept_encoding\": \"gzip, deflate, br\",\n \"accept_language\": \"en-US,en;q=0.9\",\n \"connection\": null,\n \"host\": \"api-staging.boltapp.com\",\n \"referer\": \"https://merchant-staging.boltapp.com/\",\n \"user_agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36\"\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://merchant-url.com/api/webhooks_transaction")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"pending\",\n \"object\": \"transaction\",\n \"data\": {\n \"id\": \"T1c3p4yBuVYJ9\",\n \"type\": \"cc_payment\",\n \"processor\": \"adyen_gateway\",\n \"date\": 1615407159447,\n \"reference\": \"LBLJ-TWW7-R9VC\",\n \"status\": \"cancelled\",\n \"from_user\": {\n \"id\": \"T1c3p4yBuVYJ9\",\n \"first_name\": \"Charlotte\",\n \"last_name\": \"Charles\",\n \"phones\": [\n [\n {\n \"id\": \"123\",\n \"number\": \"867-5309\",\n \"country_code\": \"1\",\n \"status\": \"active\",\n \"priority\": \"primary\"\n }\n ]\n ],\n \"emails\": [\n {\n \"id\": \"123\",\n \"address\": \"my.email@gmail.com\",\n \"status\": \"active\",\n \"priority\": \"primary\"\n }\n ]\n },\n \"from_credit_card\": {\n \"id\": \"AB3rJKam5DhYE\",\n \"last4\": \"4021\",\n \"network\": \"Visa\",\n \"display_network\": \"Visa\"\n },\n \"order\": {\n \"token\": \"a2b3dDc4cA5e6fg78Bg9hj0kl\",\n \"user_note\": \"This item is a gift.\",\n \"external_data\": {\n \"shopify\": \"VIP shopper\"\n },\n \"dynamic_content\": {\n \"shipping_info_notice\": \"A Notice Message\",\n \"payment_notice\": \"A Notice Message\",\n \"shipping_notice\": \"A Notice Message\",\n \"order_notice\": \"A Notice Message\",\n \"custom_fields\": [\n {\n \"external_id\": \"123456\",\n \"public_id\": \"i-123456\",\n \"label\": \"Special Field\",\n \"field_setup\": \"string\",\n \"checkout_setup\": \"string\",\n \"position\": 1,\n \"required\": true,\n \"dynamic\": false,\n \"subscribe_to_newsletter\": false\n }\n ],\n \"hide_apm\": [],\n \"gift_option_view\": {\n \"hide_gift_wrap\": false,\n \"hide_gift_message\": false\n }\n }\n },\n \"captures\": [\n {\n \"id\": \"BcDE4fafd2a4\",\n \"status\": \"succeeded\",\n \"amount\": {\n \"amount\": 754,\n \"currency\": \"USD\",\n \"currency_symbol\": \"$\"\n },\n \"splits\": [\n {\n \"amount\": {\n \"amount\": 754,\n \"currency\": \"USD\",\n \"currency_symbol\": \"$\"\n },\n \"type\": \"processing_fee\"\n }\n ]\n }\n ],\n \"refund_transactions\": [\n {\n \"id\": \"T1c3p4yBuVYJ9\",\n \"type\": \"cc_payment\",\n \"processor\": \"adyen_gateway\",\n \"date\": 1615407159447,\n \"reference\": \"LBLJ-TWW7-R9VC\",\n \"status\": \"cancelled\",\n \"captures\": [\n {\n \"id\": \"BcDE4fafd2a4\",\n \"status\": \"succeeded\",\n \"amount\": {\n \"amount\": 754,\n \"currency\": \"USD\",\n \"currency_symbol\": \"$\"\n },\n \"splits\": [\n {\n \"amount\": {\n \"amount\": 754,\n \"currency\": \"USD\",\n \"currency_symbol\": \"$\"\n },\n \"type\": \"processing_fee\"\n }\n ]\n }\n ],\n \"credit\": {},\n \"transaction_properties\": {\n \"avs_result\": \"avs result\",\n \"cvv_result\": \"cvv result\"\n },\n \"indemnification_decision\": \"indemnified\",\n \"indemnification_reason\": \"checkout\",\n \"last_viewed_utc\": 1485997169003,\n \"last4\": \"4021\",\n \"risk_insights\": {\n \"available\": true,\n \"fraud_probability\": 943,\n \"decision_factors\": [\n \"checkout_behavior\"\n ],\n \"payment_instrument_factors\": {\n \"avs\": \"avs result\",\n \"cvv\": \"cvv result\"\n }\n },\n \"order_decision\": {\n \"score\": \"680\",\n \"decision_factors\": [\n \"checkout_behavior\"\n ]\n },\n \"merchant_order_number\": \"O-1234567\",\n \"splits\": [\n {\n \"amount\": {\n \"amount\": 754,\n \"currency\": \"USD\",\n \"currency_symbol\": \"$\"\n },\n \"type\": \"processing_fee\"\n }\n ],\n \"review_ticket\": {\n \"id\": \"2d34a56\",\n \"status\": \"reviewed\",\n \"request_deadline\": 1627955971268\n }\n }\n ],\n \"risk_signals\": {\n \"ip_address\": \"147.92.88.21\",\n \"time_on_site\": \"00:08:42\",\n \"http_headers\": {\n \"accept\": \"application/json\",\n \"accept_encoding\": \"gzip, deflate, br\",\n \"accept_language\": \"en-US,en;q=0.9\",\n \"connection\": null,\n \"host\": \"api-staging.boltapp.com\",\n \"referer\": \"https://merchant-staging.boltapp.com/\",\n \"user_agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36\"\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "succeeded"
}{
"status": "failed",
"error": {
"code": 2001005,
"data": [
{
"reason": "This product is out of stock."
}
]
}
}Webhooks
Transaction Webhooks
This request updates the merchant on the status of the transaction.
POST
/
webhooks_transaction
Transaction Webhooks
curl --request POST \
--url https://merchant-url.com/api/webhooks_transaction \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"type": "pending",
"object": "transaction",
"data": {
"id": "T1c3p4yBuVYJ9",
"type": "cc_payment",
"processor": "adyen_gateway",
"date": 1615407159447,
"reference": "LBLJ-TWW7-R9VC",
"status": "cancelled",
"from_user": {
"id": "T1c3p4yBuVYJ9",
"first_name": "Charlotte",
"last_name": "Charles",
"phones": [
[
{
"id": "123",
"number": "867-5309",
"country_code": "1",
"status": "active",
"priority": "primary"
}
]
],
"emails": [
{
"id": "123",
"address": "my.email@gmail.com",
"status": "active",
"priority": "primary"
}
]
},
"from_credit_card": {
"id": "AB3rJKam5DhYE",
"last4": "4021",
"network": "Visa",
"display_network": "Visa"
},
"order": {
"token": "a2b3dDc4cA5e6fg78Bg9hj0kl",
"user_note": "This item is a gift.",
"external_data": {
"shopify": "VIP shopper"
},
"dynamic_content": {
"shipping_info_notice": "A Notice Message",
"payment_notice": "A Notice Message",
"shipping_notice": "A Notice Message",
"order_notice": "A Notice Message",
"custom_fields": [
{
"external_id": "123456",
"public_id": "i-123456",
"label": "Special Field",
"field_setup": "string",
"checkout_setup": "string",
"position": 1,
"required": true,
"dynamic": false,
"subscribe_to_newsletter": false
}
],
"hide_apm": [],
"gift_option_view": {
"hide_gift_wrap": false,
"hide_gift_message": false
}
}
},
"captures": [
{
"id": "BcDE4fafd2a4",
"status": "succeeded",
"amount": {
"amount": 754,
"currency": "USD",
"currency_symbol": "$"
},
"splits": [
{
"amount": {
"amount": 754,
"currency": "USD",
"currency_symbol": "$"
},
"type": "processing_fee"
}
]
}
],
"refund_transactions": [
{
"id": "T1c3p4yBuVYJ9",
"type": "cc_payment",
"processor": "adyen_gateway",
"date": 1615407159447,
"reference": "LBLJ-TWW7-R9VC",
"status": "cancelled",
"captures": [
{
"id": "BcDE4fafd2a4",
"status": "succeeded",
"amount": {
"amount": 754,
"currency": "USD",
"currency_symbol": "$"
},
"splits": [
{
"amount": {
"amount": 754,
"currency": "USD",
"currency_symbol": "$"
},
"type": "processing_fee"
}
]
}
],
"credit": {},
"transaction_properties": {
"avs_result": "avs result",
"cvv_result": "cvv result"
},
"indemnification_decision": "indemnified",
"indemnification_reason": "checkout",
"last_viewed_utc": 1485997169003,
"last4": "4021",
"risk_insights": {
"available": true,
"fraud_probability": 943,
"decision_factors": [
"checkout_behavior"
],
"payment_instrument_factors": {
"avs": "avs result",
"cvv": "cvv result"
}
},
"order_decision": {
"score": "680",
"decision_factors": [
"checkout_behavior"
]
},
"merchant_order_number": "O-1234567",
"splits": [
{
"amount": {
"amount": 754,
"currency": "USD",
"currency_symbol": "$"
},
"type": "processing_fee"
}
],
"review_ticket": {
"id": "2d34a56",
"status": "reviewed",
"request_deadline": 1627955971268
}
}
],
"risk_signals": {
"ip_address": "147.92.88.21",
"time_on_site": "00:08:42",
"http_headers": {
"accept": "application/json",
"accept_encoding": "gzip, deflate, br",
"accept_language": "en-US,en;q=0.9",
"connection": null,
"host": "api-staging.boltapp.com",
"referer": "https://merchant-staging.boltapp.com/",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36"
}
}
}
}
'import requests
url = "https://merchant-url.com/api/webhooks_transaction"
payload = {
"type": "pending",
"object": "transaction",
"data": {
"id": "T1c3p4yBuVYJ9",
"type": "cc_payment",
"processor": "adyen_gateway",
"date": 1615407159447,
"reference": "LBLJ-TWW7-R9VC",
"status": "cancelled",
"from_user": {
"id": "T1c3p4yBuVYJ9",
"first_name": "Charlotte",
"last_name": "Charles",
"phones": [[
{
"id": "123",
"number": "867-5309",
"country_code": "1",
"status": "active",
"priority": "primary"
}
]],
"emails": [
{
"id": "123",
"address": "my.email@gmail.com",
"status": "active",
"priority": "primary"
}
]
},
"from_credit_card": {
"id": "AB3rJKam5DhYE",
"last4": "4021",
"network": "Visa",
"display_network": "Visa"
},
"order": {
"token": "a2b3dDc4cA5e6fg78Bg9hj0kl",
"user_note": "This item is a gift.",
"external_data": { "shopify": "VIP shopper" },
"dynamic_content": {
"shipping_info_notice": "A Notice Message",
"payment_notice": "A Notice Message",
"shipping_notice": "A Notice Message",
"order_notice": "A Notice Message",
"custom_fields": [
{
"external_id": "123456",
"public_id": "i-123456",
"label": "Special Field",
"field_setup": "string",
"checkout_setup": "string",
"position": 1,
"required": True,
"dynamic": False,
"subscribe_to_newsletter": False
}
],
"hide_apm": [],
"gift_option_view": {
"hide_gift_wrap": False,
"hide_gift_message": False
}
}
},
"captures": [
{
"id": "BcDE4fafd2a4",
"status": "succeeded",
"amount": {
"amount": 754,
"currency": "USD",
"currency_symbol": "$"
},
"splits": [
{
"amount": {
"amount": 754,
"currency": "USD",
"currency_symbol": "$"
},
"type": "processing_fee"
}
]
}
],
"refund_transactions": [
{
"id": "T1c3p4yBuVYJ9",
"type": "cc_payment",
"processor": "adyen_gateway",
"date": 1615407159447,
"reference": "LBLJ-TWW7-R9VC",
"status": "cancelled",
"captures": [
{
"id": "BcDE4fafd2a4",
"status": "succeeded",
"amount": {
"amount": 754,
"currency": "USD",
"currency_symbol": "$"
},
"splits": [
{
"amount": {
"amount": 754,
"currency": "USD",
"currency_symbol": "$"
},
"type": "processing_fee"
}
]
}
],
"credit": {},
"transaction_properties": {
"avs_result": "avs result",
"cvv_result": "cvv result"
},
"indemnification_decision": "indemnified",
"indemnification_reason": "checkout",
"last_viewed_utc": 1485997169003,
"last4": "4021",
"risk_insights": {
"available": True,
"fraud_probability": 943,
"decision_factors": ["checkout_behavior"],
"payment_instrument_factors": {
"avs": "avs result",
"cvv": "cvv result"
}
},
"order_decision": {
"score": "680",
"decision_factors": ["checkout_behavior"]
},
"merchant_order_number": "O-1234567",
"splits": [
{
"amount": {
"amount": 754,
"currency": "USD",
"currency_symbol": "$"
},
"type": "processing_fee"
}
],
"review_ticket": {
"id": "2d34a56",
"status": "reviewed",
"request_deadline": 1627955971268
}
}
],
"risk_signals": {
"ip_address": "147.92.88.21",
"time_on_site": "00:08:42",
"http_headers": {
"accept": "application/json",
"accept_encoding": "gzip, deflate, br",
"accept_language": "en-US,en;q=0.9",
"connection": None,
"host": "api-staging.boltapp.com",
"referer": "https://merchant-staging.boltapp.com/",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36"
}
}
}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'pending',
object: 'transaction',
data: {
id: 'T1c3p4yBuVYJ9',
type: 'cc_payment',
processor: 'adyen_gateway',
date: 1615407159447,
reference: 'LBLJ-TWW7-R9VC',
status: 'cancelled',
from_user: {
id: 'T1c3p4yBuVYJ9',
first_name: 'Charlotte',
last_name: 'Charles',
phones: [
[
{
id: '123',
number: '867-5309',
country_code: '1',
status: 'active',
priority: 'primary'
}
]
],
emails: [
{
id: '123',
address: 'my.email@gmail.com',
status: 'active',
priority: 'primary'
}
]
},
from_credit_card: {id: 'AB3rJKam5DhYE', last4: '4021', network: 'Visa', display_network: 'Visa'},
order: {
token: 'a2b3dDc4cA5e6fg78Bg9hj0kl',
user_note: 'This item is a gift.',
external_data: {shopify: 'VIP shopper'},
dynamic_content: {
shipping_info_notice: 'A Notice Message',
payment_notice: 'A Notice Message',
shipping_notice: 'A Notice Message',
order_notice: 'A Notice Message',
custom_fields: [
{
external_id: '123456',
public_id: 'i-123456',
label: 'Special Field',
field_setup: 'string',
checkout_setup: 'string',
position: 1,
required: true,
dynamic: false,
subscribe_to_newsletter: false
}
],
hide_apm: [],
gift_option_view: {hide_gift_wrap: false, hide_gift_message: false}
}
},
captures: [
{
id: 'BcDE4fafd2a4',
status: 'succeeded',
amount: {amount: 754, currency: 'USD', currency_symbol: '$'},
splits: [
{
amount: {amount: 754, currency: 'USD', currency_symbol: '$'},
type: 'processing_fee'
}
]
}
],
refund_transactions: [
{
id: 'T1c3p4yBuVYJ9',
type: 'cc_payment',
processor: 'adyen_gateway',
date: 1615407159447,
reference: 'LBLJ-TWW7-R9VC',
status: 'cancelled',
captures: [
{
id: 'BcDE4fafd2a4',
status: 'succeeded',
amount: {amount: 754, currency: 'USD', currency_symbol: '$'},
splits: [
{
amount: {amount: 754, currency: 'USD', currency_symbol: '$'},
type: 'processing_fee'
}
]
}
],
credit: {},
transaction_properties: {avs_result: 'avs result', cvv_result: 'cvv result'},
indemnification_decision: 'indemnified',
indemnification_reason: 'checkout',
last_viewed_utc: 1485997169003,
last4: '4021',
risk_insights: {
available: true,
fraud_probability: 943,
decision_factors: ['checkout_behavior'],
payment_instrument_factors: {avs: 'avs result', cvv: 'cvv result'}
},
order_decision: {score: '680', decision_factors: ['checkout_behavior']},
merchant_order_number: 'O-1234567',
splits: [
{
amount: {amount: 754, currency: 'USD', currency_symbol: '$'},
type: 'processing_fee'
}
],
review_ticket: {id: '2d34a56', status: 'reviewed', request_deadline: 1627955971268}
}
],
risk_signals: {
ip_address: '147.92.88.21',
time_on_site: '00:08:42',
http_headers: {
accept: 'application/json',
accept_encoding: 'gzip, deflate, br',
accept_language: 'en-US,en;q=0.9',
connection: null,
host: 'api-staging.boltapp.com',
referer: 'https://merchant-staging.boltapp.com/',
user_agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36'
}
}
}
})
};
fetch('https://merchant-url.com/api/webhooks_transaction', 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://merchant-url.com/api/webhooks_transaction",
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([
'type' => 'pending',
'object' => 'transaction',
'data' => [
'id' => 'T1c3p4yBuVYJ9',
'type' => 'cc_payment',
'processor' => 'adyen_gateway',
'date' => 1615407159447,
'reference' => 'LBLJ-TWW7-R9VC',
'status' => 'cancelled',
'from_user' => [
'id' => 'T1c3p4yBuVYJ9',
'first_name' => 'Charlotte',
'last_name' => 'Charles',
'phones' => [
[
[
'id' => '123',
'number' => '867-5309',
'country_code' => '1',
'status' => 'active',
'priority' => 'primary'
]
]
],
'emails' => [
[
'id' => '123',
'address' => 'my.email@gmail.com',
'status' => 'active',
'priority' => 'primary'
]
]
],
'from_credit_card' => [
'id' => 'AB3rJKam5DhYE',
'last4' => '4021',
'network' => 'Visa',
'display_network' => 'Visa'
],
'order' => [
'token' => 'a2b3dDc4cA5e6fg78Bg9hj0kl',
'user_note' => 'This item is a gift.',
'external_data' => [
'shopify' => 'VIP shopper'
],
'dynamic_content' => [
'shipping_info_notice' => 'A Notice Message',
'payment_notice' => 'A Notice Message',
'shipping_notice' => 'A Notice Message',
'order_notice' => 'A Notice Message',
'custom_fields' => [
[
'external_id' => '123456',
'public_id' => 'i-123456',
'label' => 'Special Field',
'field_setup' => 'string',
'checkout_setup' => 'string',
'position' => 1,
'required' => true,
'dynamic' => false,
'subscribe_to_newsletter' => false
]
],
'hide_apm' => [
],
'gift_option_view' => [
'hide_gift_wrap' => false,
'hide_gift_message' => false
]
]
],
'captures' => [
[
'id' => 'BcDE4fafd2a4',
'status' => 'succeeded',
'amount' => [
'amount' => 754,
'currency' => 'USD',
'currency_symbol' => '$'
],
'splits' => [
[
'amount' => [
'amount' => 754,
'currency' => 'USD',
'currency_symbol' => '$'
],
'type' => 'processing_fee'
]
]
]
],
'refund_transactions' => [
[
'id' => 'T1c3p4yBuVYJ9',
'type' => 'cc_payment',
'processor' => 'adyen_gateway',
'date' => 1615407159447,
'reference' => 'LBLJ-TWW7-R9VC',
'status' => 'cancelled',
'captures' => [
[
'id' => 'BcDE4fafd2a4',
'status' => 'succeeded',
'amount' => [
'amount' => 754,
'currency' => 'USD',
'currency_symbol' => '$'
],
'splits' => [
[
'amount' => [
'amount' => 754,
'currency' => 'USD',
'currency_symbol' => '$'
],
'type' => 'processing_fee'
]
]
]
],
'credit' => [
],
'transaction_properties' => [
'avs_result' => 'avs result',
'cvv_result' => 'cvv result'
],
'indemnification_decision' => 'indemnified',
'indemnification_reason' => 'checkout',
'last_viewed_utc' => 1485997169003,
'last4' => '4021',
'risk_insights' => [
'available' => true,
'fraud_probability' => 943,
'decision_factors' => [
'checkout_behavior'
],
'payment_instrument_factors' => [
'avs' => 'avs result',
'cvv' => 'cvv result'
]
],
'order_decision' => [
'score' => '680',
'decision_factors' => [
'checkout_behavior'
]
],
'merchant_order_number' => 'O-1234567',
'splits' => [
[
'amount' => [
'amount' => 754,
'currency' => 'USD',
'currency_symbol' => '$'
],
'type' => 'processing_fee'
]
],
'review_ticket' => [
'id' => '2d34a56',
'status' => 'reviewed',
'request_deadline' => 1627955971268
]
]
],
'risk_signals' => [
'ip_address' => '147.92.88.21',
'time_on_site' => '00:08:42',
'http_headers' => [
'accept' => 'application/json',
'accept_encoding' => 'gzip, deflate, br',
'accept_language' => 'en-US,en;q=0.9',
'connection' => null,
'host' => 'api-staging.boltapp.com',
'referer' => 'https://merchant-staging.boltapp.com/',
'user_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://merchant-url.com/api/webhooks_transaction"
payload := strings.NewReader("{\n \"type\": \"pending\",\n \"object\": \"transaction\",\n \"data\": {\n \"id\": \"T1c3p4yBuVYJ9\",\n \"type\": \"cc_payment\",\n \"processor\": \"adyen_gateway\",\n \"date\": 1615407159447,\n \"reference\": \"LBLJ-TWW7-R9VC\",\n \"status\": \"cancelled\",\n \"from_user\": {\n \"id\": \"T1c3p4yBuVYJ9\",\n \"first_name\": \"Charlotte\",\n \"last_name\": \"Charles\",\n \"phones\": [\n [\n {\n \"id\": \"123\",\n \"number\": \"867-5309\",\n \"country_code\": \"1\",\n \"status\": \"active\",\n \"priority\": \"primary\"\n }\n ]\n ],\n \"emails\": [\n {\n \"id\": \"123\",\n \"address\": \"my.email@gmail.com\",\n \"status\": \"active\",\n \"priority\": \"primary\"\n }\n ]\n },\n \"from_credit_card\": {\n \"id\": \"AB3rJKam5DhYE\",\n \"last4\": \"4021\",\n \"network\": \"Visa\",\n \"display_network\": \"Visa\"\n },\n \"order\": {\n \"token\": \"a2b3dDc4cA5e6fg78Bg9hj0kl\",\n \"user_note\": \"This item is a gift.\",\n \"external_data\": {\n \"shopify\": \"VIP shopper\"\n },\n \"dynamic_content\": {\n \"shipping_info_notice\": \"A Notice Message\",\n \"payment_notice\": \"A Notice Message\",\n \"shipping_notice\": \"A Notice Message\",\n \"order_notice\": \"A Notice Message\",\n \"custom_fields\": [\n {\n \"external_id\": \"123456\",\n \"public_id\": \"i-123456\",\n \"label\": \"Special Field\",\n \"field_setup\": \"string\",\n \"checkout_setup\": \"string\",\n \"position\": 1,\n \"required\": true,\n \"dynamic\": false,\n \"subscribe_to_newsletter\": false\n }\n ],\n \"hide_apm\": [],\n \"gift_option_view\": {\n \"hide_gift_wrap\": false,\n \"hide_gift_message\": false\n }\n }\n },\n \"captures\": [\n {\n \"id\": \"BcDE4fafd2a4\",\n \"status\": \"succeeded\",\n \"amount\": {\n \"amount\": 754,\n \"currency\": \"USD\",\n \"currency_symbol\": \"$\"\n },\n \"splits\": [\n {\n \"amount\": {\n \"amount\": 754,\n \"currency\": \"USD\",\n \"currency_symbol\": \"$\"\n },\n \"type\": \"processing_fee\"\n }\n ]\n }\n ],\n \"refund_transactions\": [\n {\n \"id\": \"T1c3p4yBuVYJ9\",\n \"type\": \"cc_payment\",\n \"processor\": \"adyen_gateway\",\n \"date\": 1615407159447,\n \"reference\": \"LBLJ-TWW7-R9VC\",\n \"status\": \"cancelled\",\n \"captures\": [\n {\n \"id\": \"BcDE4fafd2a4\",\n \"status\": \"succeeded\",\n \"amount\": {\n \"amount\": 754,\n \"currency\": \"USD\",\n \"currency_symbol\": \"$\"\n },\n \"splits\": [\n {\n \"amount\": {\n \"amount\": 754,\n \"currency\": \"USD\",\n \"currency_symbol\": \"$\"\n },\n \"type\": \"processing_fee\"\n }\n ]\n }\n ],\n \"credit\": {},\n \"transaction_properties\": {\n \"avs_result\": \"avs result\",\n \"cvv_result\": \"cvv result\"\n },\n \"indemnification_decision\": \"indemnified\",\n \"indemnification_reason\": \"checkout\",\n \"last_viewed_utc\": 1485997169003,\n \"last4\": \"4021\",\n \"risk_insights\": {\n \"available\": true,\n \"fraud_probability\": 943,\n \"decision_factors\": [\n \"checkout_behavior\"\n ],\n \"payment_instrument_factors\": {\n \"avs\": \"avs result\",\n \"cvv\": \"cvv result\"\n }\n },\n \"order_decision\": {\n \"score\": \"680\",\n \"decision_factors\": [\n \"checkout_behavior\"\n ]\n },\n \"merchant_order_number\": \"O-1234567\",\n \"splits\": [\n {\n \"amount\": {\n \"amount\": 754,\n \"currency\": \"USD\",\n \"currency_symbol\": \"$\"\n },\n \"type\": \"processing_fee\"\n }\n ],\n \"review_ticket\": {\n \"id\": \"2d34a56\",\n \"status\": \"reviewed\",\n \"request_deadline\": 1627955971268\n }\n }\n ],\n \"risk_signals\": {\n \"ip_address\": \"147.92.88.21\",\n \"time_on_site\": \"00:08:42\",\n \"http_headers\": {\n \"accept\": \"application/json\",\n \"accept_encoding\": \"gzip, deflate, br\",\n \"accept_language\": \"en-US,en;q=0.9\",\n \"connection\": null,\n \"host\": \"api-staging.boltapp.com\",\n \"referer\": \"https://merchant-staging.boltapp.com/\",\n \"user_agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36\"\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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://merchant-url.com/api/webhooks_transaction")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"pending\",\n \"object\": \"transaction\",\n \"data\": {\n \"id\": \"T1c3p4yBuVYJ9\",\n \"type\": \"cc_payment\",\n \"processor\": \"adyen_gateway\",\n \"date\": 1615407159447,\n \"reference\": \"LBLJ-TWW7-R9VC\",\n \"status\": \"cancelled\",\n \"from_user\": {\n \"id\": \"T1c3p4yBuVYJ9\",\n \"first_name\": \"Charlotte\",\n \"last_name\": \"Charles\",\n \"phones\": [\n [\n {\n \"id\": \"123\",\n \"number\": \"867-5309\",\n \"country_code\": \"1\",\n \"status\": \"active\",\n \"priority\": \"primary\"\n }\n ]\n ],\n \"emails\": [\n {\n \"id\": \"123\",\n \"address\": \"my.email@gmail.com\",\n \"status\": \"active\",\n \"priority\": \"primary\"\n }\n ]\n },\n \"from_credit_card\": {\n \"id\": \"AB3rJKam5DhYE\",\n \"last4\": \"4021\",\n \"network\": \"Visa\",\n \"display_network\": \"Visa\"\n },\n \"order\": {\n \"token\": \"a2b3dDc4cA5e6fg78Bg9hj0kl\",\n \"user_note\": \"This item is a gift.\",\n \"external_data\": {\n \"shopify\": \"VIP shopper\"\n },\n \"dynamic_content\": {\n \"shipping_info_notice\": \"A Notice Message\",\n \"payment_notice\": \"A Notice Message\",\n \"shipping_notice\": \"A Notice Message\",\n \"order_notice\": \"A Notice Message\",\n \"custom_fields\": [\n {\n \"external_id\": \"123456\",\n \"public_id\": \"i-123456\",\n \"label\": \"Special Field\",\n \"field_setup\": \"string\",\n \"checkout_setup\": \"string\",\n \"position\": 1,\n \"required\": true,\n \"dynamic\": false,\n \"subscribe_to_newsletter\": false\n }\n ],\n \"hide_apm\": [],\n \"gift_option_view\": {\n \"hide_gift_wrap\": false,\n \"hide_gift_message\": false\n }\n }\n },\n \"captures\": [\n {\n \"id\": \"BcDE4fafd2a4\",\n \"status\": \"succeeded\",\n \"amount\": {\n \"amount\": 754,\n \"currency\": \"USD\",\n \"currency_symbol\": \"$\"\n },\n \"splits\": [\n {\n \"amount\": {\n \"amount\": 754,\n \"currency\": \"USD\",\n \"currency_symbol\": \"$\"\n },\n \"type\": \"processing_fee\"\n }\n ]\n }\n ],\n \"refund_transactions\": [\n {\n \"id\": \"T1c3p4yBuVYJ9\",\n \"type\": \"cc_payment\",\n \"processor\": \"adyen_gateway\",\n \"date\": 1615407159447,\n \"reference\": \"LBLJ-TWW7-R9VC\",\n \"status\": \"cancelled\",\n \"captures\": [\n {\n \"id\": \"BcDE4fafd2a4\",\n \"status\": \"succeeded\",\n \"amount\": {\n \"amount\": 754,\n \"currency\": \"USD\",\n \"currency_symbol\": \"$\"\n },\n \"splits\": [\n {\n \"amount\": {\n \"amount\": 754,\n \"currency\": \"USD\",\n \"currency_symbol\": \"$\"\n },\n \"type\": \"processing_fee\"\n }\n ]\n }\n ],\n \"credit\": {},\n \"transaction_properties\": {\n \"avs_result\": \"avs result\",\n \"cvv_result\": \"cvv result\"\n },\n \"indemnification_decision\": \"indemnified\",\n \"indemnification_reason\": \"checkout\",\n \"last_viewed_utc\": 1485997169003,\n \"last4\": \"4021\",\n \"risk_insights\": {\n \"available\": true,\n \"fraud_probability\": 943,\n \"decision_factors\": [\n \"checkout_behavior\"\n ],\n \"payment_instrument_factors\": {\n \"avs\": \"avs result\",\n \"cvv\": \"cvv result\"\n }\n },\n \"order_decision\": {\n \"score\": \"680\",\n \"decision_factors\": [\n \"checkout_behavior\"\n ]\n },\n \"merchant_order_number\": \"O-1234567\",\n \"splits\": [\n {\n \"amount\": {\n \"amount\": 754,\n \"currency\": \"USD\",\n \"currency_symbol\": \"$\"\n },\n \"type\": \"processing_fee\"\n }\n ],\n \"review_ticket\": {\n \"id\": \"2d34a56\",\n \"status\": \"reviewed\",\n \"request_deadline\": 1627955971268\n }\n }\n ],\n \"risk_signals\": {\n \"ip_address\": \"147.92.88.21\",\n \"time_on_site\": \"00:08:42\",\n \"http_headers\": {\n \"accept\": \"application/json\",\n \"accept_encoding\": \"gzip, deflate, br\",\n \"accept_language\": \"en-US,en;q=0.9\",\n \"connection\": null,\n \"host\": \"api-staging.boltapp.com\",\n \"referer\": \"https://merchant-staging.boltapp.com/\",\n \"user_agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36\"\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://merchant-url.com/api/webhooks_transaction")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"pending\",\n \"object\": \"transaction\",\n \"data\": {\n \"id\": \"T1c3p4yBuVYJ9\",\n \"type\": \"cc_payment\",\n \"processor\": \"adyen_gateway\",\n \"date\": 1615407159447,\n \"reference\": \"LBLJ-TWW7-R9VC\",\n \"status\": \"cancelled\",\n \"from_user\": {\n \"id\": \"T1c3p4yBuVYJ9\",\n \"first_name\": \"Charlotte\",\n \"last_name\": \"Charles\",\n \"phones\": [\n [\n {\n \"id\": \"123\",\n \"number\": \"867-5309\",\n \"country_code\": \"1\",\n \"status\": \"active\",\n \"priority\": \"primary\"\n }\n ]\n ],\n \"emails\": [\n {\n \"id\": \"123\",\n \"address\": \"my.email@gmail.com\",\n \"status\": \"active\",\n \"priority\": \"primary\"\n }\n ]\n },\n \"from_credit_card\": {\n \"id\": \"AB3rJKam5DhYE\",\n \"last4\": \"4021\",\n \"network\": \"Visa\",\n \"display_network\": \"Visa\"\n },\n \"order\": {\n \"token\": \"a2b3dDc4cA5e6fg78Bg9hj0kl\",\n \"user_note\": \"This item is a gift.\",\n \"external_data\": {\n \"shopify\": \"VIP shopper\"\n },\n \"dynamic_content\": {\n \"shipping_info_notice\": \"A Notice Message\",\n \"payment_notice\": \"A Notice Message\",\n \"shipping_notice\": \"A Notice Message\",\n \"order_notice\": \"A Notice Message\",\n \"custom_fields\": [\n {\n \"external_id\": \"123456\",\n \"public_id\": \"i-123456\",\n \"label\": \"Special Field\",\n \"field_setup\": \"string\",\n \"checkout_setup\": \"string\",\n \"position\": 1,\n \"required\": true,\n \"dynamic\": false,\n \"subscribe_to_newsletter\": false\n }\n ],\n \"hide_apm\": [],\n \"gift_option_view\": {\n \"hide_gift_wrap\": false,\n \"hide_gift_message\": false\n }\n }\n },\n \"captures\": [\n {\n \"id\": \"BcDE4fafd2a4\",\n \"status\": \"succeeded\",\n \"amount\": {\n \"amount\": 754,\n \"currency\": \"USD\",\n \"currency_symbol\": \"$\"\n },\n \"splits\": [\n {\n \"amount\": {\n \"amount\": 754,\n \"currency\": \"USD\",\n \"currency_symbol\": \"$\"\n },\n \"type\": \"processing_fee\"\n }\n ]\n }\n ],\n \"refund_transactions\": [\n {\n \"id\": \"T1c3p4yBuVYJ9\",\n \"type\": \"cc_payment\",\n \"processor\": \"adyen_gateway\",\n \"date\": 1615407159447,\n \"reference\": \"LBLJ-TWW7-R9VC\",\n \"status\": \"cancelled\",\n \"captures\": [\n {\n \"id\": \"BcDE4fafd2a4\",\n \"status\": \"succeeded\",\n \"amount\": {\n \"amount\": 754,\n \"currency\": \"USD\",\n \"currency_symbol\": \"$\"\n },\n \"splits\": [\n {\n \"amount\": {\n \"amount\": 754,\n \"currency\": \"USD\",\n \"currency_symbol\": \"$\"\n },\n \"type\": \"processing_fee\"\n }\n ]\n }\n ],\n \"credit\": {},\n \"transaction_properties\": {\n \"avs_result\": \"avs result\",\n \"cvv_result\": \"cvv result\"\n },\n \"indemnification_decision\": \"indemnified\",\n \"indemnification_reason\": \"checkout\",\n \"last_viewed_utc\": 1485997169003,\n \"last4\": \"4021\",\n \"risk_insights\": {\n \"available\": true,\n \"fraud_probability\": 943,\n \"decision_factors\": [\n \"checkout_behavior\"\n ],\n \"payment_instrument_factors\": {\n \"avs\": \"avs result\",\n \"cvv\": \"cvv result\"\n }\n },\n \"order_decision\": {\n \"score\": \"680\",\n \"decision_factors\": [\n \"checkout_behavior\"\n ]\n },\n \"merchant_order_number\": \"O-1234567\",\n \"splits\": [\n {\n \"amount\": {\n \"amount\": 754,\n \"currency\": \"USD\",\n \"currency_symbol\": \"$\"\n },\n \"type\": \"processing_fee\"\n }\n ],\n \"review_ticket\": {\n \"id\": \"2d34a56\",\n \"status\": \"reviewed\",\n \"request_deadline\": 1627955971268\n }\n }\n ],\n \"risk_signals\": {\n \"ip_address\": \"147.92.88.21\",\n \"time_on_site\": \"00:08:42\",\n \"http_headers\": {\n \"accept\": \"application/json\",\n \"accept_encoding\": \"gzip, deflate, br\",\n \"accept_language\": \"en-US,en;q=0.9\",\n \"connection\": null,\n \"host\": \"api-staging.boltapp.com\",\n \"referer\": \"https://merchant-staging.boltapp.com/\",\n \"user_agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36\"\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "succeeded"
}{
"status": "failed",
"error": {
"code": 2001005,
"data": [
{
"reason": "This product is out of stock."
}
]
}
}Authorizations
Admins and Developers can obtain their Bolt API key from the Bolt Merchant Dashboard.
Headers
Bolt sends a signed HMAC for hook verification
Body
application/json
- auth
- capture
- credit
- failed_payment
- newsletter_subscription
- payment
- rejected_irreversible
- risk_insights
- void
The type of webhook. For auth webhooks, a notification is only triggered if the authorization included a risk review.
IMPORTANT: The One Of buttons above reflect the webhook type and change the schema below (within data). Please make sure to select the correct webhook type according to your needs.
Available options:
auth, capture, credit, failed_payment, newsletter_subscription, payment, pending, rejected_irreversible, risk_insights, void Example:
"pending"
Available options:
transaction Example:
"transaction"
This is a generic wrapper for the merchant's data. Open to see properties.
Show child attributes
Show child attributes
Response
Webhooks Transaction Response
Available options:
succeeded, failed Example:
"succeeded"