Credit Card Webhooks (BETA)
curl --request POST \
--url https://merchant-url.com/api/webhooks_credit_card \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"type": "credit_card_deleted",
"object": "credit_card",
"data": {
"user": {
"id": "b2vghjk2v4c5fgdh3jak",
"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"
}
]
},
"credit_card": {
"id": "AB3rJKam5DhYE",
"last4": "4021",
"bin": "402201",
"expiration": 1654041600000,
"display_network": "Visa",
"token_type": "bolt",
"priority": "primary",
"status": "active"
}
}
}
'import requests
url = "https://merchant-url.com/api/webhooks_credit_card"
payload = {
"type": "credit_card_deleted",
"object": "credit_card",
"data": {
"user": {
"id": "b2vghjk2v4c5fgdh3jak",
"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"
}
]
},
"credit_card": {
"id": "AB3rJKam5DhYE",
"last4": "4021",
"bin": "402201",
"expiration": 1654041600000,
"display_network": "Visa",
"token_type": "bolt",
"priority": "primary",
"status": "active"
}
}
}
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: 'credit_card_deleted',
object: 'credit_card',
data: {
user: {
id: 'b2vghjk2v4c5fgdh3jak',
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'
}
]
},
credit_card: {
id: 'AB3rJKam5DhYE',
last4: '4021',
bin: '402201',
expiration: 1654041600000,
display_network: 'Visa',
token_type: 'bolt',
priority: 'primary',
status: 'active'
}
}
})
};
fetch('https://merchant-url.com/api/webhooks_credit_card', 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_credit_card",
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' => 'credit_card_deleted',
'object' => 'credit_card',
'data' => [
'user' => [
'id' => 'b2vghjk2v4c5fgdh3jak',
'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'
]
]
],
'credit_card' => [
'id' => 'AB3rJKam5DhYE',
'last4' => '4021',
'bin' => '402201',
'expiration' => 1654041600000,
'display_network' => 'Visa',
'token_type' => 'bolt',
'priority' => 'primary',
'status' => 'active'
]
]
]),
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_credit_card"
payload := strings.NewReader("{\n \"type\": \"credit_card_deleted\",\n \"object\": \"credit_card\",\n \"data\": {\n \"user\": {\n \"id\": \"b2vghjk2v4c5fgdh3jak\",\n \"first_name\": \"Charlotte\",\n \"last_name\": \"Charles\",\n \"phones\": [\n {\n \"id\": \"123\",\n \"number\": \"867-5309\",\n \"country_code\": \"1\",\n \"status\": \"active\",\n \"priority\": \"primary\"\n }\n ],\n \"emails\": [\n {\n \"id\": \"123\",\n \"address\": \"my.email@gmail.com\",\n \"status\": \"active\",\n \"priority\": \"primary\"\n }\n ]\n },\n \"credit_card\": {\n \"id\": \"AB3rJKam5DhYE\",\n \"last4\": \"4021\",\n \"bin\": \"402201\",\n \"expiration\": 1654041600000,\n \"display_network\": \"Visa\",\n \"token_type\": \"bolt\",\n \"priority\": \"primary\",\n \"status\": \"active\"\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_credit_card")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"credit_card_deleted\",\n \"object\": \"credit_card\",\n \"data\": {\n \"user\": {\n \"id\": \"b2vghjk2v4c5fgdh3jak\",\n \"first_name\": \"Charlotte\",\n \"last_name\": \"Charles\",\n \"phones\": [\n {\n \"id\": \"123\",\n \"number\": \"867-5309\",\n \"country_code\": \"1\",\n \"status\": \"active\",\n \"priority\": \"primary\"\n }\n ],\n \"emails\": [\n {\n \"id\": \"123\",\n \"address\": \"my.email@gmail.com\",\n \"status\": \"active\",\n \"priority\": \"primary\"\n }\n ]\n },\n \"credit_card\": {\n \"id\": \"AB3rJKam5DhYE\",\n \"last4\": \"4021\",\n \"bin\": \"402201\",\n \"expiration\": 1654041600000,\n \"display_network\": \"Visa\",\n \"token_type\": \"bolt\",\n \"priority\": \"primary\",\n \"status\": \"active\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://merchant-url.com/api/webhooks_credit_card")
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\": \"credit_card_deleted\",\n \"object\": \"credit_card\",\n \"data\": {\n \"user\": {\n \"id\": \"b2vghjk2v4c5fgdh3jak\",\n \"first_name\": \"Charlotte\",\n \"last_name\": \"Charles\",\n \"phones\": [\n {\n \"id\": \"123\",\n \"number\": \"867-5309\",\n \"country_code\": \"1\",\n \"status\": \"active\",\n \"priority\": \"primary\"\n }\n ],\n \"emails\": [\n {\n \"id\": \"123\",\n \"address\": \"my.email@gmail.com\",\n \"status\": \"active\",\n \"priority\": \"primary\"\n }\n ]\n },\n \"credit_card\": {\n \"id\": \"AB3rJKam5DhYE\",\n \"last4\": \"4021\",\n \"bin\": \"402201\",\n \"expiration\": 1654041600000,\n \"display_network\": \"Visa\",\n \"token_type\": \"bolt\",\n \"priority\": \"primary\",\n \"status\": \"active\"\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
Credit Card Webhooks (BETA)
This request notifies merchants on changes to a existing customer’s saved credit card information.
POST
/
webhooks_credit_card
Credit Card Webhooks (BETA)
curl --request POST \
--url https://merchant-url.com/api/webhooks_credit_card \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"type": "credit_card_deleted",
"object": "credit_card",
"data": {
"user": {
"id": "b2vghjk2v4c5fgdh3jak",
"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"
}
]
},
"credit_card": {
"id": "AB3rJKam5DhYE",
"last4": "4021",
"bin": "402201",
"expiration": 1654041600000,
"display_network": "Visa",
"token_type": "bolt",
"priority": "primary",
"status": "active"
}
}
}
'import requests
url = "https://merchant-url.com/api/webhooks_credit_card"
payload = {
"type": "credit_card_deleted",
"object": "credit_card",
"data": {
"user": {
"id": "b2vghjk2v4c5fgdh3jak",
"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"
}
]
},
"credit_card": {
"id": "AB3rJKam5DhYE",
"last4": "4021",
"bin": "402201",
"expiration": 1654041600000,
"display_network": "Visa",
"token_type": "bolt",
"priority": "primary",
"status": "active"
}
}
}
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: 'credit_card_deleted',
object: 'credit_card',
data: {
user: {
id: 'b2vghjk2v4c5fgdh3jak',
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'
}
]
},
credit_card: {
id: 'AB3rJKam5DhYE',
last4: '4021',
bin: '402201',
expiration: 1654041600000,
display_network: 'Visa',
token_type: 'bolt',
priority: 'primary',
status: 'active'
}
}
})
};
fetch('https://merchant-url.com/api/webhooks_credit_card', 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_credit_card",
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' => 'credit_card_deleted',
'object' => 'credit_card',
'data' => [
'user' => [
'id' => 'b2vghjk2v4c5fgdh3jak',
'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'
]
]
],
'credit_card' => [
'id' => 'AB3rJKam5DhYE',
'last4' => '4021',
'bin' => '402201',
'expiration' => 1654041600000,
'display_network' => 'Visa',
'token_type' => 'bolt',
'priority' => 'primary',
'status' => 'active'
]
]
]),
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_credit_card"
payload := strings.NewReader("{\n \"type\": \"credit_card_deleted\",\n \"object\": \"credit_card\",\n \"data\": {\n \"user\": {\n \"id\": \"b2vghjk2v4c5fgdh3jak\",\n \"first_name\": \"Charlotte\",\n \"last_name\": \"Charles\",\n \"phones\": [\n {\n \"id\": \"123\",\n \"number\": \"867-5309\",\n \"country_code\": \"1\",\n \"status\": \"active\",\n \"priority\": \"primary\"\n }\n ],\n \"emails\": [\n {\n \"id\": \"123\",\n \"address\": \"my.email@gmail.com\",\n \"status\": \"active\",\n \"priority\": \"primary\"\n }\n ]\n },\n \"credit_card\": {\n \"id\": \"AB3rJKam5DhYE\",\n \"last4\": \"4021\",\n \"bin\": \"402201\",\n \"expiration\": 1654041600000,\n \"display_network\": \"Visa\",\n \"token_type\": \"bolt\",\n \"priority\": \"primary\",\n \"status\": \"active\"\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_credit_card")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"credit_card_deleted\",\n \"object\": \"credit_card\",\n \"data\": {\n \"user\": {\n \"id\": \"b2vghjk2v4c5fgdh3jak\",\n \"first_name\": \"Charlotte\",\n \"last_name\": \"Charles\",\n \"phones\": [\n {\n \"id\": \"123\",\n \"number\": \"867-5309\",\n \"country_code\": \"1\",\n \"status\": \"active\",\n \"priority\": \"primary\"\n }\n ],\n \"emails\": [\n {\n \"id\": \"123\",\n \"address\": \"my.email@gmail.com\",\n \"status\": \"active\",\n \"priority\": \"primary\"\n }\n ]\n },\n \"credit_card\": {\n \"id\": \"AB3rJKam5DhYE\",\n \"last4\": \"4021\",\n \"bin\": \"402201\",\n \"expiration\": 1654041600000,\n \"display_network\": \"Visa\",\n \"token_type\": \"bolt\",\n \"priority\": \"primary\",\n \"status\": \"active\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://merchant-url.com/api/webhooks_credit_card")
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\": \"credit_card_deleted\",\n \"object\": \"credit_card\",\n \"data\": {\n \"user\": {\n \"id\": \"b2vghjk2v4c5fgdh3jak\",\n \"first_name\": \"Charlotte\",\n \"last_name\": \"Charles\",\n \"phones\": [\n {\n \"id\": \"123\",\n \"number\": \"867-5309\",\n \"country_code\": \"1\",\n \"status\": \"active\",\n \"priority\": \"primary\"\n }\n ],\n \"emails\": [\n {\n \"id\": \"123\",\n \"address\": \"my.email@gmail.com\",\n \"status\": \"active\",\n \"priority\": \"primary\"\n }\n ]\n },\n \"credit_card\": {\n \"id\": \"AB3rJKam5DhYE\",\n \"last4\": \"4021\",\n \"bin\": \"402201\",\n \"expiration\": 1654041600000,\n \"display_network\": \"Visa\",\n \"token_type\": \"bolt\",\n \"priority\": \"primary\",\n \"status\": \"active\"\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
Response
Webhooks Transaction Response
Available options:
succeeded, failed Example:
"succeeded"