Staying in the Loop

WebhookEndpoints are your direct line to real-time updates from Portal Pay. Let's dive into how you can set up and leverage these powerful notification tools.

Endpoints

Portal Pay provides three key endpoints for managing your WebhookEndpoints:

  1. Create a new endpoint: POST /webhook/endpoints
  2. Retrieve endpoint details: GET /webhook/endpoints/{id}
  3. Remove an endpoint: DELETE /webhook/endpoints/{id}

What is a WebhookEndpoint?

Think of a WebhookEndpoint as a special phone number you give to Portal Pay. Whenever something important happens (like a new payment or a status change), Portal Pay calls this number to let your system know immediately.

❗️

at-least-once-delivery:

Portal Pay guarantees at-least-once delivery. Make sure your webhook handling is idempotent to smoothly process potential duplicate notifications without hiccups.

Key Features

  1. Reliable Delivery: We use Svix, a robust webhook delivery service, to ensure you never miss an update.
  2. Comprehensive Updates: Each WebhookEndpoint receives all webhook messages, giving you a complete picture of your Portal Pay activity.
  3. Secure Communication: We provide a secret key for each endpoint denoted by secret, allowing you to verify (with Svix libraries) that incoming webhooks are genuinely from Portal Pay.

Webhook Message Structure

Every webhook message from Portal Pay follows this consistent format:

{
  "event_type": string,
  "object_id": UUID,
  "object_type: "string",
  "object": {...}
}

The object_id is the Portay Pay UUID of the object_type represented by nested object.

  • event_type: Tells you what happened (e.g., "payment.created")
  • object_id: The unique identifier of the affected object
  • object_type: What kind of object it is (e.g., "Payment")
  • object: The full details of the updated object

Event Types You Can Track

event_typeObjectDescription
transaction.createdTransactionRequestA new TransactionRequest has been initiated
transaction.updatedTransactionRequestA TransactionRequest was updated
payment.createdPaymentA new Payment was created
payment.updatedPaymentA Payment was updated

By leveraging WebhookEndpoints effectively, you're ensuring that your system stays perfectly in sync with Portal Pay, providing a seamless experience for you and your customers.