Create event subscription

Use this method to subscribe to events that you want us to notify you about, for example, when we change the status of a processing account. You can subscribe to more than one event in the request. For a complete list of events you can subscribe to, go to Events.


In the response we return the ID of the event subscription, which you need for the following methods:

Headers

AuthorizationstringRequired

Bearer authentication of the form Bearer <token>, where token is your auth token.

Idempotency-KeystringRequired

Unique identifier that you generate for each request. You must use the UUID v4 format for the identifier. For more information about the idempotency key, go to Idempotency.

Request

This endpoint expects an object.
enabledbooleanRequired

Indicates if we should notify you if the event occurs. The value is one of the following:

  • true - We notify you when the event occurs.
  • false - We don’t notify you when the event occurs.
eventTypeslist of stringsRequired

Array of eventTypes that you want to subscribe to. For a list of all events that you can subscribe to, go to Events.

notificationslist of objectsRequired

Array of notifications, which includes information about how we contact you when an event occurs.

idintegerOptional

Unique identifier that we assigned to the event subscription.

statusenumOptional

Status of the subscription. We return one of the following values:

  • registered - You have set up the subscription, and we will notify you when an event occurs.
  • suspended - We have deactivated the event subscription, and we won’t notify you when an event occurs.
  • failed - We couldn’t contact your URI endpoint. We email the supportEmailAddress.
Allowed values:
metadataobjectOptional

Object that you can send to include custom data in the request. For more information about how to use metadata, go to Metadata.

Response

Successful request. We created the event subscription.

enabledboolean

Indicates if we should notify you if the event occurs. The value is one of the following:

  • true - We notify you when the event occurs.
  • false - We don’t notify you when the event occurs.
eventTypeslist of strings

Array of eventTypes that you want to subscribe to. For a list of all events that you can subscribe to, go to Events.

notificationslist of objects

Array of notifications, which includes information about how we contact you when an event occurs.

idintegerOptional

Unique identifier that we assigned to the event subscription.

statusenumOptional

Status of the subscription. We return one of the following values:

  • registered - You have set up the subscription, and we will notify you when an event occurs.
  • suspended - We have deactivated the event subscription, and we won’t notify you when an event occurs.
  • failed - We couldn’t contact your URI endpoint. We email the supportEmailAddress.
Allowed values:
metadataobjectOptional

Object that you can send to include custom data in the request. For more information about how to use metadata, go to Metadata.