Webhooks
Webhooks allow you to subscribe to real-time notifications about various events that occur in any program at Partnero.
Available events
These are all the events you can listen to and send a notification for.
Event | Description |
---|---|
partner.created | Fired when the new partner signups or is created manually. |
partner.updated | Fired when existing partner is updated. |
partner.deleted | Fired when a partner is deleted. |
customer.created | Fired when the new customer is created. |
customer.updated | Fired when existing customer is updated. |
customer.deleted | Fired when existing customer is deleted. |
transaction.created | Fired when new transaction happens. |
transaction.deleted | Fired when transaction is deleted. |
Get a list of webhooks
If you want to retrieve information about current webhooks for your program, use this GET
request:
GET https://api.partnero.com/v1/webhooks
Request parameters
Parameters | Type | Required | Details |
---|---|---|---|
limit | integer | no | A limit on the number of items to be returned. Limits can range between 10 and 100, and the default is 10. |
page | integer | no | The default is 1. |
Response
{
"data": [
{
"key": "i1G7ExNCGI7s",
"name": "All Customer",
"url": "https://webhook.site/a3d48421-176a-46r1-a367-e1ffhc0af045",
"is_active": true,
"signature": "uy51DfvoJ7mUm2Ua",
"events": [
"customer.created",
"customer.updated",
"customer.deleted"
]
},
...
],
}
Response Code: 200 OK
Create a webhook
Create a webhook using this POST
request:
POST https://api.partnero.com/v1/webhooks
Request parameters
Parameters | Type | Required | Limitations | Details |
---|---|---|---|---|
key | string | optional | Unique id of the webhook in the API. We recommend leaving this blank so we can generate an unique one. | |
name | string | yes | Name of webhook | |
url | string | yes | URL where webhook event will be handled | |
is_active | boolean | optional | Default true | |
events | array | yes | Array of events that this webhook will handled |
Request example
{
"name": "Demo",
"url": "https://webhook.site/e68d154a-ad82-4ddd-9b05-622ec1577638",
"events": [
"partner.created"
]
}
Response
{
"data": {
"key": "6HCtIMKX8han",
"name": "Demo",
"url": "https://webhook.site/e68d154a-ad82-4ddd-9b05-622ec1577638",
"is_active": true,
"signature": "Ewi7TWkdARdV41GI",
"events": [
"partner.created"
]
},
"status": 1
}
Response Code: 200 OK
Fetch a webhook
To retrieve information about a single webhook, use this GET
request:
GET https://api.partnero.com/v1/webhooks/{key}
Request example
GET https://api.partnero.com/v1/webhooks/6HCtIMKX8han
Response
{
"data": {
"key": "6HCtIMKX8han",
"name": "Demo",
"url": "https://webhook.site/e68d154a-ad82-4ddd-9b05-622ec1577638",
"is_active": true,
"signature": "Ewi7TWkdARdV41GI",
"events": [
"partner.created"
]
},
"status": 1
}
Response Code: 200 OK
Update a webhook
Update a webhook using this PUT
request:
PUT https://api.partnero.com/v1/webhooks/{key}
Request parameters
Parameters | Type | Required | Limitations | Details |
---|---|---|---|---|
name | string | optional | ||
url | string | optional | ||
is_active | boolean | optional | ||
events | array | optional |
Request example
{
"name": "Demo 2"
}
PUT https://api.partnero.com/v1/webhooks/6HCtIMKX8han
Response
{
"data": {
"key": "6HCtIMKX8han",
"name": "Demo 2",
"url": "https://webhook.site/e68d154a-ad82-4ddd-9b05-622ec1577638",
"is_active": true,
"signature": "Ewi7TWkdARdV41GI",
"events": [
"partner.created"
]
},
"status": 1
}
Response Code: 200 OK
Delete a webhook
Delete a webhook using this DELETE
request:
DELETE https://api.partnero.com/v1/webhooks/{key}
Request example
DELETE https://api.partnero.com/v1/webhooks/6HCtIMKX8han
Response
{
"status": 1
}
Response Code: 200 OK