Customizing QR Ph Code Expiry

Learn how to customize the expiry time for QR Ph payment methods in PayMongo, including setting custom expiry durations and understanding when the expiry timer starts.

By default, QR Ph codes expire in 30 minutes. However, you can customize this expiry time to better suit your business needs by adding the expiry_seconds attribute when creating a payment method.

Setting Custom Expiry Time

To customize the expiry time, include the expiry_seconds attribute in your payment method creation request:

POST /v1/payment_methods
{
  "data": {
    "attributes": {
      "type": "qrph",
      "expiry_seconds": 600, // 10 minutes (up to 9000 seconds or 2.5 hours)
      "billing": {
        "address": {
          "line1": "line1",
          "line2": "line2",
          "city": "Manila",
          "state": "NCR",
          "postal_code": "1000",
          "country": "PH"
        },
        "email": "[email protected]",
        "name": "Customer Name",
        "phone": "09111111111"
      }
    }
  }
}

Expiry Time Limits

The expiry_seconds attribute accepts values:

  • Minimum: 60 seconds (defaults to 30 minutes if not provided)
  • Maximum: 9,000 seconds (2.5 hours)

When Expiry Timer Starts

⚠️ Important: The expiry timer begins counting down when you call the attach endpoint:

POST /v1/payment_intents/{id}/attach

This means the QR Ph code will remain valid for the specified duration starting from when it's attached to a payment intent, not from when the payment method was initially created.