Subscriptions
Subscriptions are the way to manage your webhooks programmatically. On this page, we'll dive into the different subscription endpoints you can use to manage subscriptions programmatically. We'll look at how to query, create and delete subscriptions.
The subscription model
The subscription model contains all the information about subscriptions, such as their name, notificationUrl, and the event the hook is for.
Properties
- Name
id
- Type
- string
- Description
Unique identifier for the subscription.
- Name
notificationUrl
- Type
- string
- Description
The url that will called when the hook is activated.
- Name
event
- Type
- string
- Description
The event that triggers this subscription.
List all subscriptions
This endpoint allows you to retrieve a paginated list of all subscriptions. By default, a maximum of ten subscriptions are shown per page.
Optional attributes
- Name
skip
- Type
- integer
- Description
Limit the number of subscriptions returned.
- Name
take
- Type
- integer
- Description
Take this number of records.
Request
curl --location https://partner.punt-uit.nl/api/fulfilment/v3/subscriptions \
--header "Authorization: Bearer {token}"
Response
[
{
"id": "clf29lzon000h8rj700avuas6",
"notificationUrl": "https://yourdomain.com/hook",
"event": "list-status",
},
{
"id": "clf29lzon000h8rj700avuad1"
// ...
}
]
Register a subscription
This endpoint allows you to add an subscription.
Required attributes
- Name
body
- Type
- json
- Description
json containing the subscription to create. Refer to the subscription model at the top of this page to see the properties we support.
Request
curl https://partner.punt-uit.nl/api/fulfilment/v3/subscriptions \
-H "Authorization: Bearer {token}" \
-d '{
"notificationUrl": "https://yourdomain.com/hook",
"event": "shipment-shipped"
}
Response
{
"id": "phzic5xldc6ve4mqfhifisvdnm0jvssu",
"notificationUrl": "https://yourdomain.com/hook",
"event": "shipment-shipped"
}
View a subscription
This endpoint allows you to retrieve an subscription by providing the id. Refer to the subscription model at the top of this page to see which properties are included with subscription objects.
Request
curl --location https://partner.punt-uit.nl/api/fulfilment/v3/subscriptions/phzic5xldc6ve4mqfhifisvdnm0jvssu \
--header "Authorization: Bearer {token}"
Response
{
"id": "phzic5xldc6ve4mqfhifisvdnm0jvssu",
"notificationUrl": "https://yourdomain.com/hook",
"event": "shipment-shipped"
}
Delete a subscription
This endpoint allows you to delete a subscription.
Request
curl --location --request DELETE https://partner.punt-uit.nl/api/fulfilment/v3/subscriptions/phzic5xldc6ve4mqfhifisvdnm0jvssu \
--header "Authorization: Bearer {token}"