Webhook Endpoints API Beta

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": "2018-12-14T14:53:58Z",
    "updated_at": "2018-12-14T14:53:58Z"
  }
}

Error Responses

422 invalid_resource {...}
{
  "error": "invalid_resource",
  "error_description": "One or more parameters were missing or invalid",
  "messages": [
    {
      "code": "url_invalid",
      "message": "url is not a valid URL",
      "param": "url"
    }
  ]
}
403 limit_reached {...}
{
  "error": "limit_reached",
  "error_description": "You have reached the maximum number of allowed webhook endpoints."
}

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": "2018-12-14T14:53:58Z",
      "updated_at": "2018-12-14T14:53:58Z"
    }
  ],
  "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": "2018-12-14T14:53:58Z",
    "updated_at": "2018-12-14T14:53:58Z"
  }
}

Error Responses

404 resource_not_found {...}
{
  "error": "resource_not_found",
  "error_description": "No resource was found at this URL."
}

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 {...}
{
  "error": "resource_not_found",
  "error_description": "No resource was found at this URL."
}

Pin Payments is owned and operated by
Southern Payment Systems Pty Ltd
ABN: 46 154 451 582
Level 1, 34 Queen St,
Melbourne VIC 3000

Privacy Policy Terms Security Status

Australia