Webhooks Content

Testing Connectivity

When you use the Test Connectivity button, a successful test will generate a 200 message in the back office UI.

The webhook payload for a connectivity request looks like this.

{
	"mode": "test",
	"eventDate": "2018-09-05T13:32:12Z",
	"eventType": "test",
	"attemptNumber": 1
}

Webhooks Content

When one of the Subscriptions events is triggered, a callback is made to the endpoint that you provided on the Configure Webhooks page. The following example response is for a typical Subscription Creation event.

Webhook Example
{
	"resourceId": "05c94632-3a39-4fd7-b21c-410e0a58b478",
	"mode": "live",
	"eventDate": "2018-09-20T18:30:39Z",
	"eventType": "SP_SUBSCRIPTION_CREATED",
	"attemptNumber": 0,
	"payload": {
		"planId": "eb3ba103-6d38-45d5-9ec2-ef88ad3eb64b",
		"merchantRefNum": "sub-2018-09-20-cc-001",
		"startDate": "2021-12-15",
		"endDate": "2031-12-31",
		"status": "ACTIVE"
	},
	"links": [{
		"rel": "subscription",
		"href": "https://api.test.paysafe.com/subscriptionsplans/v1/subscriptions/05c94632-3a39-4fd7-b21c-410e0a58b478{?expand}"
	}]
}

The following table describes the elements in the webhook example:

Element Type Constraints Description
resourceId String Length <= 255 The ID of the resource that has changed.
mode String live/test
  • live – This is a production event
  • test – This is a test event created sent from the merchant back office.
eventDate dateTime UTC formatted date This is the date and time the event occurred.
eventType String Length <= 255 This is the type of event. In this example, SP_SUBSCRIPTION_CREATED indicates that a subscription was created.
attemptNumber Integer This is the number of times this event has been sent.
payload Complex

The payload varies depending on the eventType.

links Complex This is a link to the resource.

Subscription Event Payload Elements

The following table describes the elements contained in the callback payload objects.

Element Type Child Elements Event
merchantRefNum

String

Length<=255

  • All
planId

String

Length<=36

  • All
status Enum
  • All
startDate

String

YYYY-MM-DD

  • SP_SUBSCRIPTION_CREATED
  • SP_SUBSCRIPTION_MODIFIED
endDate

String

YYYY-MM-DD

  • SP_SUBSCRIPTION_CREATED
  • SP_SUBSCRIPTION_MODIFIED
billingPeriodStartDate

String

YYYY-MM-DD

  • SP_PAYMENT_UPCOMING
  • SP_PAYMENT_SUCCESS
  • SP_PAYMENT_FAILED
billingPeriodEndDate

String

YYYY-MM-DD

  • SP_PAYMENT_UPCOMING
  • SP_PAYMENT_SUCCESS
  • SP_PAYMENT_FAILED
nextPayment Object
  • amount
  • paymentMethod
  • paymentDate
  • SP_PAYMENT_UPCOMING
previousPayment Object
  • amount
  • paymentMethod
  • paymentDate
  • status
  • SP_PAYMENT_SUCCESS
  • SP_PAYMENT_FAILED
invoice Object
  • numberOfAttempts
  • SP_PAYMENT_SUCCESS
  • SP_PAYMENT_FAILED
effectiveCancellationDate

String

YYYY-MM-DD

  • SP_SUBSCRIPTION_CANCELLED
reasonForCancellation

String

Length<=255

  • SP_SUBSCRIPTION_CANCELLED

Did you find this page useful?