E-commerce

Payment Transaction JSON Example

Payment transaction JSON example with amount, currency, method, gateway ID, and refund records. Copy-ready for Stripe, Razorpay, and other payment gateway integrations.

{
  "id": "pay_3PQkBN2eZvKYlo2M",
  "orderId": "ord_7TnVqRx2kL",
  "amount": 315120,
  "amountDecimal": 3151.2,
  "currency": "INR",
  "status": "captured",
  "method": "upi",
  "gateway": "razorpay",
  "gatewayTransactionId": "pay_OmMgcv1lksBMvS",
  "description": "Payment for order ord_7TnVqRx2kL",
  "metadata": {
    "upiId": "ravi@upi",
    "ipAddress": "103.45.67.89",
    "deviceType": "mobile"
  },
  "refunds": [],
  "createdAt": "2025-05-01T10:30:02Z",
  "capturedAt": "2025-05-01T10:30:08Z",
  "expiresAt": null
}

Field Reference

amountrequiredintegerAmount in the smallest currency unit (paise for INR, cents for USD). Avoids floating-point precision bugs.
amountDecimaloptionalnumberHuman-readable amount with decimal point. Derived from amount / 100. Use only for display.
currencyrequiredstring (ISO 4217)Three-letter currency code: INR, USD, EUR, GBP.
statusrequiredstringPayment lifecycle: created, authorized, captured, failed, refunded, cancelled.
gatewayTransactionIdrequiredstringTransaction ID from the payment gateway. Use this when initiating refunds or raising disputes.
refundsoptionalarrayList of refund objects. Store refunds here rather than reducing the original amount.

Variants

Card PaymentCredit/debit card transaction with masked card details.
{
  "id": "pay_4QRlCO3fAwLZmp3N",
  "amount": 49990,
  "currency": "USD",
  "status": "captured",
  "method": "card",
  "card": {
    "brand": "visa",
    "last4": "4242",
    "expMonth": 12,
    "expYear": 2027,
    "funding": "credit"
  },
  "gateway": "stripe",
  "gatewayTransactionId": "ch_3PQkBN2eZvKYlo2M"
}
RefundedPayment that has been fully refunded.
{
  "id": "pay_2MNjAL1dYuJXkn1L",
  "amount": 150000,
  "currency": "INR",
  "status": "refunded",
  "refunds": [
    {
      "id": "ref_1",
      "amount": 150000,
      "reason": "Customer request",
      "createdAt": "2025-05-10T14:00:00Z"
    }
  ],
  "createdAt": "2025-05-05T09:00:00Z",
  "refundedAt": "2025-05-10T14:00:05Z"
}

Common Use Cases

  • Payment gateway webhook handler data model
  • Financial ledger and accounting system integration
  • Invoice and receipt PDF generation
paymenttransactionStripeRazorpayfinancegateway

Validate or format this JSON

One click loads this exact example into the tool — no copy-paste needed. Format it, validate it, explore the tree, or generate TypeScript types instantly.

Frequently Asked Questions

Float numbers cannot represent all decimal values exactly (0.1 + 0.2 = 0.30000000000000004). Storing amounts as integers in the smallest currency unit (paise, cents) eliminates this entire class of rounding bugs.

Authorized means the card has been pre-approved and funds reserved but not yet collected. Captured means the money has moved. Hotels and marketplaces often separate these steps; most e-commerce sites authorize and capture in a single step.

Store refunds as a nested array on the original payment. Do not modify the original amount. The net amount is amount minus the sum of all refund amounts. This creates a full audit trail.

Related JSON Examples