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:
- Create a new endpoint:
POST /webhook/endpoints
- Retrieve endpoint details:
GET /webhook/endpoints/{id}
- 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
- Reliable Delivery: We use Svix, a robust webhook delivery service, to ensure you never miss an update.
- Comprehensive Updates: Each WebhookEndpoint receives all webhook messages, giving you a complete picture of your Portal Pay activity.
- 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 objectobject_type
: What kind of object it is (e.g., "Payment")object
: The full details of the updated object
Event Types You Can Track
event_type | Object | Description |
---|---|---|
transaction.created | TransactionRequest | A new TransactionRequest has been initiated |
transaction.updated | TransactionRequest | A TransactionRequest was updated |
payment.created | Payment | A new Payment was created |
payment.updated | Payment | A 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.