Webhooks API Beta

The webhooks API allows you to view and replay webhooks—requests that have been sent to your webhook endpoints. When an event occurs, Pin Payments creates a webhook record and sends a web request to each of your endpoints.

Replaying a webhook causes Pin Payments to request the URL again. It will not repeat other webhook requests for the same event. Replaying a webhook will reset the error information recorded during the original request and record any new errors that occur during the replay.

Webhooks are only guaranteed to be stored for 30 days after they are created.

GET /webhooks

Returns a paginated list of all webhooks.

Example

curl https://test-api.pinpayments.com/1/webhooks -u your-secret-api-key:
200 OK
{
  "response": [
    {
      "token": "whr_87H4fafROQsdI5PrtyI",
      "status": "completed",
      "url": "http://www.google.com/?signature=ee4f5023a182b408fee81f9131d04dcb865b2a6dbeeb343b0cc0213b94ffa05f",
      "event_token": "evt_12K4fafROQsdI5PdwLkX",
      "webhook_endpoint_token": "whe_4I23afROQsdI5Csjo",
      "created_at": "2018-12-14T14:35:24Z",
      "accepted_at": "2018-12-14T14:35:24Z",
      "next_run": null,
      "retries": 0,
      "errors": {
      }
    }
  ],
  "pagination": {
    "count": 1,
    "per_page": 25,
    "current": 1
  }
}

GET /webhooks/webhook-token

Returns the details of a webhook.

Example

curl https://test-api.pinpayments.com/1/webhooks/whr_87H4fafROQsdI5PrtyI -u your-secret-api-key:
200 OK
{
  "response": {
    "token": "whr_87H4fafROQsdI5PrtyI",
    "status": "retrying",
    "url": "http://www.google.com/?signature=ee4f5023a182b408fee81f9131d04dcb865b2a6dbeeb343b0cc0213b94ffa05f",
    "event_token": "evt_12K4fafROQsdI5PdwLkX",
    "webhook_endpoint_token": "whe_4I23afROQsdI5Csjo",
    "created_at": "2018-12-14T14:35:24Z",
    "accepted_at": null,
    "next_run": "2018-12-14T14:36:24Z",
    "retries": 1,
    "errors": {
      "2018-12-14 14:35:24 UTC": {
        "error": "unexpected_http_code",
        "error_description": "Unexpected http code 405"
      }
    }
  }
}

Error Responses

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

PUT /webhooks/webhook-token/replay

Replays a webhook.

Example

curl https://test-api.pinpayments.com/1/webhooks/whr_87H4fafROQsdI5PrtyI/replay -u your-secret-api-key: -X PUT
200 OK
{
  "response": {
    "token": "whr_87H4fafROQsdI5PrtyI",
    "status": "pending",
    "url": "http://www.google.com/?signature=ee4f5023a182b408fee81f9131d04dcb865b2a6dbeeb343b0cc0213b94ffa05f",
    "event_token": "evt_12K4fafROQsdI5PdwLkX",
    "webhook_endpoint_token": "whe_4I23afROQsdI5Csjo",
    "created_at": "2018-12-14T14:35:24Z",
    "accepted_at": null,
    "next_run": null,
    "retries": 0,
    "errors": {
    }
  }
}

Error Responses

404 resource_not_found {...}
{
  "error": "resource_not_found",
  "error_description": "No resource was found at this URL."
}
400 cannot_replay_webhook {...}
{
  "error": "cannot_replay_webhook",
  "error_description": "Webhook cannot be replayed"
}

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