Create Webhook Subscription
Request
Send your HTTP requests with an Authorization
header that contains the word Basic followed by a space and a base64-encoded string username:password
Example:Authorization: Basic *****************
Body Params application/json
{
"url": "https://webhook.site/some-uuid",
"events": [
"payto_agreement.activated",
"payto_payment.cleared"
]
}
Request Code Samples
curl --location --request POST 'https://api-sandbox.squarepay.com.au/v2/webhook-subscriptions' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic Og==' \
--data-raw '{
"url": "https://webhook.site/some-uuid",
"events": [
"payto_agreement.activated",
"payto_payment.cleared"
]
}'
Responses
application/json {
"data": {
"webhook_subscription_id": "7e9f4299-6049-4c11-abed-dcdb27102e33",
"url": "https://webhook.site/some-uuid",
"signature_secret": "YpG4przYWpXqn7Q6pw16G2D47762UhF0LcLlBjn59oMDOh7SfujaV6EcgOd6merv",
"events": [
"payto_agreement.activated",
"payto_payment.cleared"
],
"status": "ACTIVE"
}
}
Modified at 2024-08-24 11:44:38