Skip to content

Latest commit

 

History

History
209 lines (152 loc) · 4.88 KB

webhooks.md

File metadata and controls

209 lines (152 loc) · 4.88 KB

Webhooks

Webhook-related operations

$webhooksController = $client->getWebhooksController();

Class Name

WebhooksController

Methods

List Webhook Subscriptions

Retrieve a list of all webhook subscriptions that supports filtering, sorting, and pagination through existing mechanisms.

function listWebhookSubscriptions(string $xMyPayQuickerVersion): WebhookCollectionResponse

Parameters

Parameter Type Tags Description
xMyPayQuickerVersion string Header, Required Date-based API Version specified in the header required on all calls.

Response Type

WebhookCollectionResponse

Example Usage

$xMyPayQuickerVersion = '2020.02.24';

$result = $webhooksController->listWebhookSubscriptions($xMyPayQuickerVersion);

Example Response (as JSON)

{
  "links": [
    {
      "params": {
        "rel": "self"
      },
      "href": "string"
    }
  ],
  "payload": [
    {
      "links": [
        {
          "params": {
            "rel": "self"
          },
          "href": "string"
        }
      ],
      "url": "https://www.example.com/webhooks",
      "namespace": "BANKACCOUNTS.UPDATED.STATUS.APPROVED",
      "token": "webh-2dd54a53-3814-4ce1-862f-dc06b09ead4a",
      "created": "2020-01-01",
      "lastUpdated": "2020-02-01"
    }
  ]
}

Create Webhook Subscription

Create a webhook subscription for a given URL and namespace. When this event fires, the webhook receives a call from the API.

function createWebhookSubscription(
    string $xMyPayQuickerVersion,
    ?WebhookSubscription $body = null
): WebhookSubscriptionResponse

Parameters

Parameter Type Tags Description
xMyPayQuickerVersion string Header, Required Date-based API Version specified in the header required on all calls.
body ?WebhookSubscription Body, Optional -

Response Type

WebhookSubscriptionResponse

Example Usage

$xMyPayQuickerVersion = '2020.02.24';

$result = $webhooksController->createWebhookSubscription($xMyPayQuickerVersion);

Example Response (as JSON)

{
  "links": [
    {
      "params": {
        "rel": "self"
      },
      "href": "string"
    }
  ],
  "url": "https://www.example.com/webhooks",
  "namespace": "BANKACCOUNTS.UPDATED.STATUS.APPROVED",
  "token": "webh-2dd54a53-3814-4ce1-862f-dc06b09ead4a",
  "created": "2020-01-01"
}

Retrieve Webhook Subscription

Retrieve a single webhook subscription using the webhook token.

function retrieveWebhookSubscription(
    string $webhToken,
    string $xMyPayQuickerVersion
): WebhookSubscriptionResponse

Parameters

Parameter Type Tags Description
webhToken string Template, Required -
xMyPayQuickerVersion string Header, Required Date-based API Version specified in the header required on all calls.

Response Type

WebhookSubscriptionResponse

Example Usage

$webhToken = 'webh-token0';
$xMyPayQuickerVersion = '2020.02.24';

$result = $webhooksController->retrieveWebhookSubscription($webhToken, $xMyPayQuickerVersion);

Example Response (as JSON)

{
  "links": [
    {
      "params": {
        "rel": "self"
      },
      "href": "string"
    }
  ],
  "url": "https://www.example.com/webhooks",
  "namespace": "BANKACCOUNTS.UPDATED.STATUS.APPROVED",
  "token": "webh-2dd54a53-3814-4ce1-862f-dc06b09ead4a",
  "created": "2020-01-01",
  "lastUpdated": "2020-02-01"
}

Delete Webhook Subscription

Delete a webhook subscription. Deleted webhooks no longer receive notifications about events. Deleting an already deleted webhook will result in a successful 200 (OK) response code.

function deleteWebhookSubscription(string $webhToken, string $xMyPayQuickerVersion): void

Parameters

Parameter Type Tags Description
webhToken string Template, Required -
xMyPayQuickerVersion string Header, Required Date-based API Version specified in the header required on all calls.

Response Type

void

Example Usage

$webhToken = 'webh-token0';
$xMyPayQuickerVersion = '2020.02.24';

$webhooksController->deleteWebhookSubscription($webhToken, $xMyPayQuickerVersion);