Documentation
Test environmentLive environmentStatusContact us
  • Overview
    • Get started
    • Resource guides
      • For business users
      • For finance teams
      • For integration teams
    • Stripe onboarding
    • Live use cases
      • Usage overview
  • Start using the dashboard
    • Access
    • Payment services
    • Collaborators and access control
    • One-time payment links
      • Single link creation
      • Bulk link creation
      • Send payment links
      • Payment link page
      • Payment receipt email
    • Subscriptions
      • Set-up
      • View subscriptions
      • Manage subscriptions
    • Payments and refunds
      • Payment methods
      • Dashboard
      • Refunds
    • Payouts
    • Reports
    • Payment workflows with Plumber
      • Set-up
      • Testing
    • Payment forms
      • Set-up
      • Testing
      • Resources
  • Start an API integration
    • Get started
    • Endpoints
    • Integrating with your e-services
    • Errors
    • Idempotency
    • Pagination
    • Go-live checklist
  • API RESOURCES
    • Events
      • The event object
      • Types of events
    • Payments
      • Create a payment
      • Retrieve payments
      • Send email for payment
      • Cancel a payment
      • Refund a payment
      • Get all payments from payment service
  • WEBHOOKS
    • Introduction
    • Set-up
      • Events
      • Best practices
  • FAQ
    • Access
    • Costs
    • Timeline
    • API keys
    • API integration
    • Payments
    • Payment methods
    • Payouts and transaction fees
    • Refunds
    • Security and compliance
    • Downtime and maintenance
  • Policies
    • Privacy Policy
    • Terms of Use
Powered by GitBook
On this page
  • Overview
  • Event delivery behaviours

Was this helpful?

  1. WEBHOOKS
  2. Set-up

Events

PreviousSet-upNextBest practices

Last updated 1 year ago

Was this helpful?

Overview

PaySG generates event data that you can use to inform you of activity on your payment service. When an event occurs, PaySG generates a new . For example, when a payer pays on PaySG, you receive payment.succeeded event.

By registering webhook endpoints in your payment service, you enable PaySG to automatically send as part of POST requests to the registered webhook endpoint hosted by your application.

Event Object

The Event object we send to your webhook endpoint provides a snapshot of the object that changed.

Currently, we only support the payment.succeeded event type.

Example event payload

{
  "id": "evt_752ced1f-00ce-4905-8c46-367371dd78e6",
  "data": {
    "object": {
      "id": "wLAnFWQLYyYNKBimc2ZkA",
      "due_date": null,
      "metadata": {},
      "payout_id": null,
      "created_at": "2023-07-17T17:15:12.200+08:00",
      "creator_id": "user_655d26a2-ddfc-4718-a008-bd181c1522e8",
      "payer_name": "John Doe",
      "updated_at": "2023-10-02T16:17:08.167+08:00",
      "payer_email": "abc@gmail.com",
      "payment_url": "http://pay.gov.sg/payments/payment01",
      "description": "Payment for XXX",
      "reference_id": "INV001",
      "latest_status": "paid",
      "payer_address": "36 Robinson Road, Singapore 068877",
      "refund_status": "not_refunded",
      "amount_in_cents": 12.34,
      "payment_status": "paid",
      "payer_identifier": "S1234567A",
      "paid_out_timestamp": null,
      "payment_service_id": "payment_service_fd724c82-786b-43ba-b7d7-1eecab0388e1",
      "email_delivery_status": "sent",
      "payment_sent_timestamp": "2023-07-31T10:01:48.761+08:00",
      "stripe_payment_intentId": "pi_3NUnWOLRKRlnGcim1Nzy18Z0",
      "payment_cancelled_timestamp": null,
      "payment_succeeded_timestamp": "2023-10-02T16:17:08.164+08:00",
      "payment_fully_refunded_timestamp": null
    }
  },
  "type": "payment.succeeded",
  "object": "event",
  "created_at": "2023-10-02T16:17:08.210+08:00",
  "payment_service_id": "payment_service_fd724c82-786b-43ba-b7d7-1eecab0388e1"
}

Why event object gets generated

This table describes different scenarios that trigger generating events.

Source
Trigger

PaySG platform

When a user action (i.e. pays) in the PaySG platform results in an API call

Event delivery behaviours

This section provides documentation on the different behaviors that you can expect when PaySG sends events to your webhook endpoint. Specifically, it covers event retry deliveries and event ordering.

Retry behaviour

PaySG attempts to deliver an event to your webhook endpoint for up to 3 days with an exponential back off.

If your endpoint has been deleted when PaySG attempts a retry, future retries of that event will be prevented.

Event ordering

PaySG doesn’t guarantee delivery of events in the order in which they’re generated.

Your endpoint should not expect delivery of events in order, and needs to handle out-of-order delivery accordingly.

Event object
Event objects