Create webhooks
/webhooksSubscribe an endpoint to platform events.
Permissions
webhookSubscriptions:updateRequires the `update` action on `webhookSubscriptions` for the supplied runtime context
Request body
This body is a tagged shape: type is always "WebhookCmdCreate". Send it; more variants can be added, and a caller that switches on it keeps working when they are.
typetype = "WebhookCmdCreate"urlstringrequiredAn absolute https (or http) url with a host, at most 2048 characters.
Example https://example.com/callback
eventsarray of WebhookEventTypeEvent types to deliver.
MerchantCreatedMerchantActivatedMerchantSuspendedMerchantAvailableBalanceUpdatedMerchantBankAccountAddedMerchantPrimaryBankAccountUpdatedPayPlanCreatedPayPlanActivatedPayPlanCompletedPayPlanInDefault+27 moreShow fewer
PayInFullCreated, PayInFullAccepted, PayInFullAuthorised, PayInFullCompleted, TransactionPaid, TransactionFailed, DisputeCreated, DisputeUpdated, PayoutCreated, PayoutPending, PayoutFailed, PayoutPaid, PayoutReversed, InvoiceIssued, InvoiceDue, InvoicePaymentFailed, InvoicePaid, PaymentSourceCreated, PaymentSourceMethodUpdated, PaymentSourceDeleted, LoanCreated, LoanStatementCreated, LoanStatementIssued, LoanStatementDue, LoanStatementPaid, LoanPaymentFailed, Unknown
descriptionstringWhat this subscription is for, in your own words.
metadatamap of any JSON valueFree-form data the platform stores and returns untouched.
secretstringThe secret deliveries are signed with, 16 to 256 characters with no surrounding whitespace. Write-only: it is never returned. Omit it and the platform generates one, which you then cannot read, so send your own if you mean to verify signatures.
merchantIdMchtIdThe merchant whose events to deliver. An administrator sends exactly one of this and marketplaceId. A merchant credential may omit both or name only itself. A marketplace credential may omit both, name itself as marketplaceId, or name one of its own merchants here to narrow the subscription to that merchant.
Example mcht_9f2Kd8QpLzXw
marketplaceIdMktpIdThe marketplace whose events to deliver. See merchantId.
Example mktp_9f2Kd8QpLzXw
curl -X POST https://api.tst.au.apgpay.dev/webhooks \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "WebhookCmdCreate",
"url": "https://example.com/callback",
"events": [
"MerchantCreated"
],
"description": "string",
"metadata": {
"yourKey": {}
},
"secret": "string",
"merchantId": "mcht_9f2Kd8QpLzXw",
"marketplaceId": "mktp_9f2Kd8QpLzXw"
}'Responses
The response is a tagged shape: type is always "WebhookCreateRspAttributes". Switch on it; subtypes can be added, and a client that already reads it will not break.
typetype = "WebhookCreateRspAttributes"The resource that was created.
typeenumrequiredWebhookViewAttributeswebhookIdWebhookIdrequiredIdentifier of a webhook subscription.
Example webhook_9f2Kd8QpLzXw
merchantIdMchtIdThe merchant whose events this delivers. Absent for a marketplace-wide subscription.
Example mcht_9f2Kd8QpLzXw
marketplaceIdMktpIdThe marketplace whose events this delivers.
Example mktp_9f2Kd8QpLzXw
urlstringrequiredExample https://example.com/callback
statusWebhookStatusrequiredActiveSuspendedUnknowneventsarray of WebhookEventTypeThe event types delivered.
MerchantCreatedMerchantActivatedMerchantSuspendedMerchantAvailableBalanceUpdatedMerchantBankAccountAddedMerchantPrimaryBankAccountUpdatedPayPlanCreatedPayPlanActivatedPayPlanCompletedPayPlanInDefault+27 moreShow fewer
PayInFullCreated, PayInFullAccepted, PayInFullAuthorised, PayInFullCompleted, TransactionPaid, TransactionFailed, DisputeCreated, DisputeUpdated, PayoutCreated, PayoutPending, PayoutFailed, PayoutPaid, PayoutReversed, InvoiceIssued, InvoiceDue, InvoicePaymentFailed, InvoicePaid, PaymentSourceCreated, PaymentSourceMethodUpdated, PaymentSourceDeleted, LoanCreated, LoanStatementCreated, LoanStatementIssued, LoanStatementDue, LoanStatementPaid, LoanPaymentFailed, Unknown
descriptionstringWhat this subscription is for, in your own words.
metadatamap of any JSON valueFree-form data the platform stores and returns untouched.
readablebooleanrequiredWhether the caller may read this subscription's detail. A subscription can be *listed* by a principal that may not see the endpoint it delivers to.
Example true
consecutiveFailuresinteger (int32)requiredHow many deliveries created since the newest one your endpoint accepted are Failed or Abandoned; every such delivery when none was ever accepted, and 0 when there are none. Counted by when each delivery was created, so redelivering an old failure that then succeeds does not reset it. The platform does not suspend a subscription on its own, however high this goes.
Example 1250
lastDeliveryAtstring (date-time)When we most recently tried to deliver anything to this subscription. Absent until the first attempt.
Example 2026-08-19T04:21:07Z
lastDeliveryStatusWebhookDeliveryStatusThe status of this subscription's newest delivery. Absent when it has none.
PendingPendingRetryDeliveredFailedAbandonedObservedUnknowncreatedAtstring (date-time)requiredExample 2026-08-19T04:21:07Z
updatedAtstring (date-time)requiredExample 2026-08-19T04:21:07Z
{
"type": "WebhookCreateRspAttributes",
"created": {
"type": "WebhookViewAttributes",
"webhookId": "webhook_9f2Kd8QpLzXw",
"merchantId": "mcht_9f2Kd8QpLzXw",
"marketplaceId": "mktp_9f2Kd8QpLzXw",
"url": "https://example.com/callback",
"status": "Active",
"events": [
"MerchantCreated"
],
"description": "string",
"metadata": {
"yourKey": {}
},
"readable": true,
"consecutiveFailures": 1250,
"lastDeliveryAt": "2026-08-19T04:21:07Z",
"lastDeliveryStatus": "Pending",
"createdAt": "2026-08-19T04:21:07Z",
"updatedAt": "2026-08-19T04:21:07Z"
}
}Error responses
statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}