Webhooks
Configure outbound webhook endpoints (URL, scope, signing secret) so your backend is notified when a payment's status changes, an alternative to polling Get payment.
Create webhook
https://api.gobtcpay.com/public/api/v1.2/merchant/webhook/createRegisters a webhook endpoint. Provide the destination url and a scope (merchant for the whole account, or store / pos to narrow delivery); events defaults to all event types. The response includes the signingSecret shown only once, store it to verify the X-GoBTCPay-Signature header on incoming deliveries.
Authorization: merchantAuth
Body required
application/jsonurlstringrequiredDestination URL that receives webhook deliveries.
stringscopeobjectrequiredWhich payments this endpoint receives: merchant (whole account), or store / pos to narrow delivery to one store or terminal.
eventsenum[]Event types this endpoint is subscribed to.
labelstringHuman-readable label for the POS terminal (optional).
Front deskResponses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/merchant/webhook/create" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"url": "string",
"scope": {
"type": "merchant"
},
"events": [
"payment.status.updated"
],
"label": "Front desk"
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"webhook": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"merchantId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"url": "string",
"scope": {
"type": "merchant"
},
"events": [
"payment.status.updated"
],
"status": "active",
"label": "Front desk",
"createdAt": 1718012345,
"updatedAt": 1718012345,
"signingSecret": "string"
}
}
}
}List webhooks
https://api.gobtcpay.com/public/api/v1.2/merchant/webhook/listLists the merchant's webhook endpoints with optional pagination and a status filter. Returns items and totalCount. The signingSecret is never included.
Authorization: merchantAuth
Body required
application/jsonpaginationobjectfiltersobjectResponses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/merchant/webhook/list" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"pagination": {
"limit": 20,
"skip": 0
},
"filters": {
"status": "active"
}
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"items": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"merchantId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"url": "string",
"scope": {
"type": null
},
"events": [
"payment.status.updated"
],
"status": "active",
"label": "Front desk",
"createdAt": 1718012345,
"updatedAt": 1718012345
}
],
"totalCount": 0
}
}
}Get webhook
https://api.gobtcpay.com/public/api/v1.2/merchant/webhook/getFetches a single webhook endpoint by webhookId. The signingSecret is not returned, rotate it to obtain a new one.
Authorization: merchantAuth
Body required
application/jsonwebhookIdstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6Responses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/merchant/webhook/get" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"webhookId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"webhook": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"merchantId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"url": "string",
"scope": {
"type": "merchant"
},
"events": [
"payment.status.updated"
],
"status": "active",
"label": "Front desk",
"createdAt": 1718012345,
"updatedAt": 1718012345
}
}
}
}Update webhook
https://api.gobtcpay.com/public/api/v1.2/merchant/webhook/updateUpdates the url, scope, events, status (active / disabled), and/or label of the webhook identified by webhookId. Returns the updated endpoint; the signingSecret is not re-issued.
Authorization: merchantAuth
Body required
application/jsonwebhookIdstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6urlstringDestination URL that receives webhook deliveries.
stringscopeobjectWhich payments this endpoint receives: merchant (whole account), or store / pos to narrow delivery to one store or terminal.
eventsenum[]Event types this endpoint is subscribed to.
statusenumCurrent status. Payments: initiated / detected / paid / failed / expired / canceled / cleared. Payment transactions: success / failed / pending / cleared.
activedisabledactivelabelstringHuman-readable label for the POS terminal (optional).
Front deskResponses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/merchant/webhook/update" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"webhookId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"url": "string",
"scope": {
"type": "merchant"
},
"events": [
"payment.status.updated"
],
"status": "active",
"label": "Front desk"
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"webhook": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"merchantId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"url": "string",
"scope": {
"type": "merchant"
},
"events": [
"payment.status.updated"
],
"status": "active",
"label": "Front desk",
"createdAt": 1718012345,
"updatedAt": 1718012345
}
}
}
}Delete webhook
https://api.gobtcpay.com/public/api/v1.2/merchant/webhook/deleteDeletes the webhook endpoint identified by webhookId. Returns { ok }.
Authorization: merchantAuth
Body required
application/jsonwebhookIdstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6Responses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/merchant/webhook/delete" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"webhookId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"ok": true
}
}
}Rotate webhook secret
https://api.gobtcpay.com/public/api/v1.2/merchant/webhook/rotate-secretRotates the signing secret for the webhook identified by webhookId, invalidating the previous secret and returning a fresh signingSecret (shown only once).
Authorization: merchantAuth
Body required
application/jsonwebhookIdstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6Responses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/merchant/webhook/rotate-secret" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"webhookId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"signingSecret": "string"
}
}
}Send test event
https://api.gobtcpay.com/public/api/v1.2/merchant/webhook/testDispatches a sample payment.status.updated delivery to the endpoint identified by webhookId so you can verify your receiver and signature validation. Returns { ok } once the test delivery is queued.
Authorization: merchantAuth
Body required
application/jsonwebhookIdstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6Responses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/merchant/webhook/test" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"webhookId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"ok": true
}
}
}