curl --request POST \
--url https://staging-api.chip-in.asia/api/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'checksum: <checksum>' \
--header 'epoch: <epoch>' \
--data '
{
"name": "Send Instruction Notifications",
"callback_url": "https://api.merchant.example/webhooks/chip-send",
"email": "webhooks@example.com",
"event_hooks": [
"bank_account_status",
"budget_allocation_status",
"send_instruction_status"
]
}
'import requests
url = "https://staging-api.chip-in.asia/api/webhooks"
payload = {
"name": "Send Instruction Notifications",
"callback_url": "https://api.merchant.example/webhooks/chip-send",
"email": "webhooks@example.com",
"event_hooks": ["bank_account_status", "budget_allocation_status", "send_instruction_status"]
}
headers = {
"epoch": "<epoch>",
"checksum": "<checksum>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
epoch: '<epoch>',
checksum: '<checksum>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Send Instruction Notifications',
callback_url: 'https://api.merchant.example/webhooks/chip-send',
email: 'webhooks@example.com',
event_hooks: ['bank_account_status', 'budget_allocation_status', 'send_instruction_status']
})
};
fetch('https://staging-api.chip-in.asia/api/webhooks', 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://staging-api.chip-in.asia/api/webhooks",
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([
'name' => 'Send Instruction Notifications',
'callback_url' => 'https://api.merchant.example/webhooks/chip-send',
'email' => 'webhooks@example.com',
'event_hooks' => [
'bank_account_status',
'budget_allocation_status',
'send_instruction_status'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"checksum: <checksum>",
"epoch: <epoch>"
],
]);
$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://staging-api.chip-in.asia/api/webhooks"
payload := strings.NewReader("{\n \"name\": \"Send Instruction Notifications\",\n \"callback_url\": \"https://api.merchant.example/webhooks/chip-send\",\n \"email\": \"webhooks@example.com\",\n \"event_hooks\": [\n \"bank_account_status\",\n \"budget_allocation_status\",\n \"send_instruction_status\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("epoch", "<epoch>")
req.Header.Add("checksum", "<checksum>")
req.Header.Add("Authorization", "Bearer <token>")
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://staging-api.chip-in.asia/api/webhooks")
.header("epoch", "<epoch>")
.header("checksum", "<checksum>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Send Instruction Notifications\",\n \"callback_url\": \"https://api.merchant.example/webhooks/chip-send\",\n \"email\": \"webhooks@example.com\",\n \"event_hooks\": [\n \"bank_account_status\",\n \"budget_allocation_status\",\n \"send_instruction_status\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging-api.chip-in.asia/api/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["epoch"] = '<epoch>'
request["checksum"] = '<checksum>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Send Instruction Notifications\",\n \"callback_url\": \"https://api.merchant.example/webhooks/chip-send\",\n \"email\": \"webhooks@example.com\",\n \"event_hooks\": [\n \"bank_account_status\",\n \"budget_allocation_status\",\n \"send_instruction_status\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"name": "Send Instruction Notifications",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA6gLlBKxCB5dxPJbinCzl\nhOfKSgQtOWQQBxmnWIkEVUbqhpnqr3xNYiAvDyMUxYUwuzN44eHO+mR9MZWcSx3c\nbXmKa3gsOzR6GdcOxMGaVxvfje+fujCAlCtO1BP+A9/FS3KcPgCYG1wtAPwA5IAf\nHylL3TsUVIJQFBgiBr6N4Bgapr9eloaFfeYIBRsXmxPKAMJivqxYpLh0V3N4ZFd5\nTGqSEAa4b1ULDr6p0sB2L3QikTdsF0zp03zNceKA6fXDOzD0xWtg9buXvyKwePK4\nM2kcnWBNfsWghrdg0fG3O9bmkaS1oEXydrmJfuiI8h6a64J/1nzooi2yLC9D6Ta0\nS63bbuAHymnQtiNuV7Ixp6IoTGFaS88aTiHaP8rdyWV8JTDFx0qeDzyaGWiYGwEF\nmj/buHCEcRhoajbGkPhYA4YEdn4jy1wZhEr2OMdBPM7mPPI0Hy3hcNJVMVVlrpHe\nIltQATpjlNaJMlRPjbcaiW7dsO3BuF9ZOMGksSOnyYm/AgMBAAE=\n-----END PUBLIC KEY-----",
"callback_url": "https://api.merchant.example/webhooks/chip-send",
"email": "webhooks@example.com",
"event_hooks": [
"bank_account_status",
"budget_allocation_status",
"send_instruction_status"
],
"created_at": "2024-06-15T08:00:00.000Z",
"updated_at": "2024-06-15T08:00:00.000Z"
}{
"message": "Bad request",
"code": 400,
"data": {}
}{
"message": "Unauthorized",
"code": 401,
"data": {}
}{
"message": "You are not authorized to perform this action",
"code": 403,
"data": {}
}{
"message": "Record not found",
"code": 404,
"data": {}
}Create a webhook
Creates a webhook using the values provided in the request body. When a selected event occurs, the system delivers a notification to the configured callback URL.
curl --request POST \
--url https://staging-api.chip-in.asia/api/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'checksum: <checksum>' \
--header 'epoch: <epoch>' \
--data '
{
"name": "Send Instruction Notifications",
"callback_url": "https://api.merchant.example/webhooks/chip-send",
"email": "webhooks@example.com",
"event_hooks": [
"bank_account_status",
"budget_allocation_status",
"send_instruction_status"
]
}
'import requests
url = "https://staging-api.chip-in.asia/api/webhooks"
payload = {
"name": "Send Instruction Notifications",
"callback_url": "https://api.merchant.example/webhooks/chip-send",
"email": "webhooks@example.com",
"event_hooks": ["bank_account_status", "budget_allocation_status", "send_instruction_status"]
}
headers = {
"epoch": "<epoch>",
"checksum": "<checksum>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
epoch: '<epoch>',
checksum: '<checksum>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Send Instruction Notifications',
callback_url: 'https://api.merchant.example/webhooks/chip-send',
email: 'webhooks@example.com',
event_hooks: ['bank_account_status', 'budget_allocation_status', 'send_instruction_status']
})
};
fetch('https://staging-api.chip-in.asia/api/webhooks', 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://staging-api.chip-in.asia/api/webhooks",
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([
'name' => 'Send Instruction Notifications',
'callback_url' => 'https://api.merchant.example/webhooks/chip-send',
'email' => 'webhooks@example.com',
'event_hooks' => [
'bank_account_status',
'budget_allocation_status',
'send_instruction_status'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"checksum: <checksum>",
"epoch: <epoch>"
],
]);
$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://staging-api.chip-in.asia/api/webhooks"
payload := strings.NewReader("{\n \"name\": \"Send Instruction Notifications\",\n \"callback_url\": \"https://api.merchant.example/webhooks/chip-send\",\n \"email\": \"webhooks@example.com\",\n \"event_hooks\": [\n \"bank_account_status\",\n \"budget_allocation_status\",\n \"send_instruction_status\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("epoch", "<epoch>")
req.Header.Add("checksum", "<checksum>")
req.Header.Add("Authorization", "Bearer <token>")
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://staging-api.chip-in.asia/api/webhooks")
.header("epoch", "<epoch>")
.header("checksum", "<checksum>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Send Instruction Notifications\",\n \"callback_url\": \"https://api.merchant.example/webhooks/chip-send\",\n \"email\": \"webhooks@example.com\",\n \"event_hooks\": [\n \"bank_account_status\",\n \"budget_allocation_status\",\n \"send_instruction_status\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging-api.chip-in.asia/api/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["epoch"] = '<epoch>'
request["checksum"] = '<checksum>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Send Instruction Notifications\",\n \"callback_url\": \"https://api.merchant.example/webhooks/chip-send\",\n \"email\": \"webhooks@example.com\",\n \"event_hooks\": [\n \"bank_account_status\",\n \"budget_allocation_status\",\n \"send_instruction_status\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"name": "Send Instruction Notifications",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA6gLlBKxCB5dxPJbinCzl\nhOfKSgQtOWQQBxmnWIkEVUbqhpnqr3xNYiAvDyMUxYUwuzN44eHO+mR9MZWcSx3c\nbXmKa3gsOzR6GdcOxMGaVxvfje+fujCAlCtO1BP+A9/FS3KcPgCYG1wtAPwA5IAf\nHylL3TsUVIJQFBgiBr6N4Bgapr9eloaFfeYIBRsXmxPKAMJivqxYpLh0V3N4ZFd5\nTGqSEAa4b1ULDr6p0sB2L3QikTdsF0zp03zNceKA6fXDOzD0xWtg9buXvyKwePK4\nM2kcnWBNfsWghrdg0fG3O9bmkaS1oEXydrmJfuiI8h6a64J/1nzooi2yLC9D6Ta0\nS63bbuAHymnQtiNuV7Ixp6IoTGFaS88aTiHaP8rdyWV8JTDFx0qeDzyaGWiYGwEF\nmj/buHCEcRhoajbGkPhYA4YEdn4jy1wZhEr2OMdBPM7mPPI0Hy3hcNJVMVVlrpHe\nIltQATpjlNaJMlRPjbcaiW7dsO3BuF9ZOMGksSOnyYm/AgMBAAE=\n-----END PUBLIC KEY-----",
"callback_url": "https://api.merchant.example/webhooks/chip-send",
"email": "webhooks@example.com",
"event_hooks": [
"bank_account_status",
"budget_allocation_status",
"send_instruction_status"
],
"created_at": "2024-06-15T08:00:00.000Z",
"updated_at": "2024-06-15T08:00:00.000Z"
}{
"message": "Bad request",
"code": 400,
"data": {}
}{
"message": "Unauthorized",
"code": 401,
"data": {}
}{
"message": "You are not authorized to perform this action",
"code": 403,
"data": {}
}{
"message": "Record not found",
"code": 404,
"data": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Unix epoch timestamp Unix timestamp (seconds).
1619740800
Refer to checksum calculation
Body
Request body for creating a webhook subscription.
"Send Instruction Notifications"
500"https://api.merchant.example/webhooks/chip-send"
Email notifications are sent to this address when a callback fails to be delivered.
"webhooks@example.com"
List of events to trigger webhook callbacks for.
1Available event types and when they are emitted:
bank_account_status: Emitted when a company bank account's status changes. This occurs when CHIP processes the bank account for verification.
budget_allocation_status: Emitted when a budget allocation's status changes. This occurs when an approver approves the increment.
send_instruction_status: Emitted when a company send instruction's status changes. This occurs when CHIP processes the instruction with the bank.
bank_account_status, budget_allocation_status, send_instruction_status [
"budget_allocation_status",
"bank_account_status",
"send_instruction_status"
]
Response
Successful response
A webhook subscription that delivers event notifications to your server.
1
PEM-encoded RSA public key for authenticating webhook or callback payloads
"-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA6gLlBKxCB5dxPJbinCzl\nhOfKSgQtOWQQBxmnWIkEVUbqhpnqr3xNYiAvDyMUxYUwuzN44eHO+mR9MZWcSx3c\nbXmKa3gsOzR6GdcOxMGaVxvfje+fujCAlCtO1BP+A9/FS3KcPgCYG1wtAPwA5IAf\nHylL3TsUVIJQFBgiBr6N4Bgapr9eloaFfeYIBRsXmxPKAMJivqxYpLh0V3N4ZFd5\nTGqSEAa4b1ULDr6p0sB2L3QikTdsF0zp03zNceKA6fXDOzD0xWtg9buXvyKwePK4\nM2kcnWBNfsWghrdg0fG3O9bmkaS1oEXydrmJfuiI8h6a64J/1nzooi2yLC9D6Ta0\nS63bbuAHymnQtiNuV7Ixp6IoTGFaS88aTiHaP8rdyWV8JTDFx0qeDzyaGWiYGwEF\nmj/buHCEcRhoajbGkPhYA4YEdn4jy1wZhEr2OMdBPM7mPPI0Hy3hcNJVMVVlrpHe\nIltQATpjlNaJMlRPjbcaiW7dsO3BuF9ZOMGksSOnyYm/AgMBAAE=\n-----END PUBLIC KEY-----"
500"https://api.merchant.example/webhooks/chip-send"
List of events to trigger webhook callbacks for.
1Available event types and when they are emitted:
bank_account_status: Emitted when a company bank account's status changes. This occurs when CHIP processes the bank account for verification.
budget_allocation_status: Emitted when a budget allocation's status changes. This occurs when an approver approves the increment.
send_instruction_status: Emitted when a company send instruction's status changes. This occurs when CHIP processes the instruction with the bank.
bank_account_status, budget_allocation_status, send_instruction_status Object creation time in UTC.
Object updated time in UTC.