API Reference
Webhook Endpoints API
The webhook endpoints API allows you to create and view your webhook endpoints. These are URLs that Pin Payments requests when events occur on your account.
POST /webhook_endpoints
Creates a new webhook endpoint and returns its details.
Parameters
url | The destination URL of the webhook endpoint. |
---|
Example
curl https://test-api.pinpayments.com/1/webhook_endpoints -u your-secret-api-key: \
-d "url=https://example.org/webhooks/"
201
Created
{
"response": {
"token": "whe_4I23afROQsdI5Csjo",
"key": "vSeHhoa0amv38tF3pXDtPA",
"url": "https://example.org/webhooks/",
"created_at": "2024-12-21T12:24:40Z",
"updated_at": "2024-12-21T12:24:40Z"
}
}
Error Responses
422 | invalid_resource |
{...}
|
---|---|---|
403 | limit_reached |
{...}
|
GET /webhook_endpoints
Returns a paginated list of all webhook endpoints.
Example
curl https://test-api.pinpayments.com/1/webhook_endpoints -u your-secret-api-key:
200
OK
{
"response": [
{
"token": "whe_4I23afROQsdI5Csjo",
"key": "vSeHhoa0amv38tF3pXDtPA",
"url": "https://example.org/webhooks/",
"created_at": "2024-12-21T12:24:40Z",
"updated_at": "2024-12-21T12:24:40Z"
}
],
"pagination": {
"count": 1,
"per_page": 25,
"current": 1
}
}
GET /webhook_endpoints/webhook-endpoint-token
Returns the details of the specified webhook endpoint.
Example
curl https://test-api.pinpayments.com/1/webhook_endpoints/whe_4I23afROQsdI5Csjo -u your-secret-api-key:
200
OK
{
"response": {
"token": "whe_4I23afROQsdI5Csjo",
"key": "vSeHhoa0amv38tF3pXDtPA",
"url": "https://example.org/webhooks/",
"created_at": "2024-12-21T12:24:40Z",
"updated_at": "2024-12-21T12:24:40Z"
}
}
Error Responses
404 | resource_not_found |
{...}
|
---|
DELETE /webhook_endpoints/webhook-endpoint-token
Deletes a webhook endpoint and all of its webhook requests. You will not be able to recover them.
Example
curl https://test-api.pinpayments.com/1/webhook_endpoints/whe_4I23afROQsdI5Csjo -u your-secret-api-key: -X DELETE
204
No Content
No response body.
Error Responses
404 | resource_not_found |
{...}
|
---|