Skip to main content
For general webhook concepts like bubble-up behavior, payload visibility rules, and versioned snapshots, see Webhook Concepts.

Description

This event is triggered when a new payment transaction is initiated.

Integration Details

  • Subscription Key: pay.transaction.created
  • Use Case: Track revenue in real-time or update an external financial ledger.
  • Related Events: pay.transaction.updated

Trigger

  • Event Type: pay_transaction_created
  • Source: Insertion of a record into the pay.transaction table.

Cross-Service References

The payment payload traverses the order chain to provide full purchase context:
  • Order (pay.order): Order metadata and status.
  • Order ItemsItemSKU (pay.sku): Product details including pricing and currency.
  • Coupon (pay.coupon): Discount information if applied.

Payload Example

{
  "id": 901,
  "external_id": "ext_tx_901",
  "payment_id": "pay_abc123",
  "status": "pending",
  "total_amount": 50.00,
  "currency_code": "USD",
  "narration": "Assessment credit purchase",
  "purchased_by": 123,
  "order_id": 1001,
  "payment_gateway_id": 1,
  "rule_id": null,
  "receipt_file_id": null,
  "created_at": "2023-11-15T09:00:00Z",
  "created_by": 1,
  "updated_at": "2023-11-15T09:00:00Z",
  "updated_by": 1,
  "order": {
    "id": 1001,
    "external_id": "ext_ord_1001",
    "status": "open",
    "ordered_by": 123,
    "entity_name": "candidate",
    "created_at": "2023-11-15T08:55:00Z",
    "created_by": 1,
    "updated_at": "2023-11-15T08:55:00Z",
    "updated_by": 1,
    "order_items": [
      {
        "id": 1101,
        "unit_price": 50.00,
        "total_price": 50.00,
        "quantity": 1,
        "is_reschedule": false,
        "external_id": null,
        "created_at": "2023-11-15T08:55:00Z",
        "created_by": 1,
        "updated_at": "2023-11-15T08:55:00Z",
        "updated_by": 1,
        "coupon": null,
        "item": {
          "id": 1201,
          "status": "active",
          "description": "Python Proficiency Test slot",
          "external_id": null,
          "drive_occurrence_guest_id": 777,
          "meeting_participant_id": null,
          "valid_till": "2023-12-31T23:59:59Z",
          "sku": {
            "id": 1301,
            "name": "Assessment Credit",
            "type": "credit",
            "plan_type": "one_time",
            "price": 50.00,
            "external_id": "sku_abc",
            "currency_code": "USD"
          }
        }
      }
    ]
  },
  "transaction_status_history": []
}

Payload Type Showcase

{
  id: number;
  external_id: string | null;
  payment_id: string | null;
  status: string;
  total_amount: number;
  currency_code: string | null;
  narration: string | null;
  purchased_by: number | null;
  order_id: number;
  payment_gateway_id: number | null;
  rule_id: number | null;
  receipt_file_id: number | null;
  created_at: string;
  created_by: number;
  updated_at: string;
  updated_by: number;
  order: {
    id: number;
    external_id: string | null;
    status: string;
    ordered_by: number | null;
    entity_name: string | null;
    created_at: string;
    created_by: number;
    updated_at: string;
    updated_by: number;
    order_items: {
      id: number;
      unit_price: number;
      total_price: number;
      quantity: number;
      is_reschedule: boolean;
      external_id: string | null;
      created_at: string;
      created_by: number;
      updated_at: string;
      updated_by: number;
      coupon: {
        id: number;
        code: string;
        external_id: string | null;
        discount_percentage: number;
      } | null;
      item: {
        id: number;
        status: string;
        description: string | null;
        external_id: string | null;
        drive_occurrence_guest_id: number | null;
        meeting_participant_id: number | null;
        valid_till: string | null;
        sku: {
          id: number;
          name: string;
          type: string | null;
          plan_type: string | null;
          price: number;
          external_id: string | null;
          currency_code: string;
        };
      };
    }[];
  };
  transaction_status_history: {
    id: number;
    status_from: string;
    status_to: string;
    error_message: string | null;
    created_at: string;
    created_by: number;
  }[];
}

Field Notes

  • payment_id is a UUID from the payment gateway (e.g., Stripe, Razorpay).
  • narration is a human-readable payment description.
  • transaction_status_history provides the status audit trail. Empty on creation, populated on subsequent status transitions.
  • coupon on order items is nullable — only present if a discount was applied.
  • The order → order_items → item → sku chain provides the full purchase context.