Skip to main content

Developing an API Endpoint to Handle PlanPay Webhook Events

To build a webhook integration with PlanPay, your engineering team will need to develop an API that can receive and process webhook payloads, which contain information about payment-related events. The API must adhere to the service contract for PlanPay webhook targets.

Verifying Requests to Your Webhook

We use the svix platform to enable our webhooks. svix provides mechanisms to verify the authenticity of requests to your webhook.

See the svix verifying webhooks documentation.

Understanding the API Request Payload

When working with an API, it's essential to have a clear understanding of the data structure being exchanged between the client and server. The API request payload contains the data transmitted from the client (PlanPay) to the server (your API). To help you get a better sense of what this payload may look like, here is the schema:

Any of
type
required
string
Value: "PlanCreated"
id
required
number
required
object
planId
required
string
createdAt
required
string <date-time>
vendorPaymentId
required
string or null
uniqueKey
required
string
required
object
{
  • "type": "CustomerCreated",
  • "id": 0,
  • "payload": null,
  • "planId": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "vendorPaymentId": "string",
  • "uniqueKey": "string",
  • "planDetails": {
    }
}