API Reference
Create a webhook
POST
/web_hooksEvents
There are numerous events which can be received as a webhook. All events are documented under the Events reference documentation for Webhooks.
Body Parameters
namestring(optional)A name for the web hook
modestring(optional)The mode for the web hook. Possible values are: Test or Production
addressstring(optional)The URL for the web hook to target. This must start with http:// or https://
authentication_usernamestring(optional)· Defaults to OptionalThe username for HTTP Basic authentication
authentication_passwordstring(optional)· Defaults to OptionalThe password for HTTP Basic authentication (optional)
is_activeboolean(optional)· Defaults to falseActivation flag for the webhook
eventsstring(optional)A list of events for the web hook to target. This is a comma separated list of events, and it is possible to use wildcards (e.g.* for all events, or direct_entry:* for all direct entry hooks, or direct_entry:created,direct_entry:failed)
Request
curl
curl -X POST https://gateway.pmnts-sandbox.io/v1.0/web_hooks -u TEST:TEST -d'
{
"name": "Test Hook",
"mode": "Test",
"address": "https://www.your-server.com/payment/hook",
"authentication_username": null,
"authentication_password": null,
"is_active": true,
"events": "*"
}'Response
200Result
json
{
"successful": true,
"response": {
"address": "https://www.your-server.com/payment/hook",
"events": "*",
"mode": "Test",
"authentication_username": null,
"authentication_password": "",
"is_active": true,
"name": "Test Hook",
"id": "071-WH-ABCD1234"
},
"errors": [],
"test": true
}422Result
json
{
"successful":false,
"response":{
"address":null,
"events":null,
"mode":null,
"authentication_username":null,
"authentication_password":"",
"is_active":null,
"name":null,
"id":null
},
"errors":[
"Address can't be blank",
"Events is not included in the list",
"Mode is not included in the list"
],
"test":true
}