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.

EventDescription
partner.createdFired when the new partner signups or is created manually.
partner.updatedFired when existing partner is updated.
partner.deletedFired when a partner is deleted.
customer.createdFired when the new customer is created.
customer.updatedFired when existing customer is updated.
customer.deletedFired when existing customer is deleted.
transaction.createdFired when new transaction happens.
transaction.deletedFired 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

ParametersTypeRequiredDetails
limitintegernoA limit on the number of items to be returned. Limits can range between 10 and 100, and the default is 10.
pageintegernoThe 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

ParametersTypeRequiredLimitationsDetails
keystringoptionalUnique id of the webhook in the API. We recommend leaving this blank so we can generate an unique one.
namestringyesName of webhook
urlstringyesURL where webhook event will be handled
is_activebooleanoptionalDefault true
eventsarrayyesArray 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

ParametersTypeRequiredLimitationsDetails
namestringoptional
urlstringoptional
is_activebooleanoptional
eventsarrayoptional

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