Set payment expiration
What you will learn
✅ How to set an expiration time for how long a payment remains in the queue before being cancelled
Cross River queues instant payments to be sent later if for some reason the receiving bank is offline and cannot receive the credit transfer immediately. Payments have a default queue expiration of 3 days. If the expiration is reached, Cross River cancels the payment and triggers an Rtp.Payment.Canceled webhook.
If you are new to instant payments, check out the instant payments overview.
This tutorial assumes familiarity with APIs. For more information, visit API basics.
The tutorial uses these API endpoints:
Transfers funds between banks in real time via an Instant Payments network | |
|---|---|
Cancels a payment request if a credit transfer or payment request response has not been received. |
Before you begin
Make sure you have:
- Your partner ID
- Your master account number
- Registered the following webhook events:
Rtp.Payment.Queued | Payment queued for sending when the receiving financial institution comes back online |
|---|---|
Rtp.Payment.Canceled | Payment canceled |
Set queued payment expiration time
To set the expiration time follow the the send an instant payment tutorial, with the expiration time details set as either a specific date and time or a time in seconds. If both are provided, the system prioritizes the time in seconds and ignores the date and time.
Define an expiration for a specific date and time (queuedPaymentExpiresAt)
- Use the queuedPaymentExpiresAt attribute in your payment request.
- Format: yyyy-mm-ddThh:mm:ss (US Eastern Time).
- The value must be a future date and time.
- For reference, the sample request includes this attribute on row 17.
POST /v1/payments
{
"accountNumber": "2553179843",
"amount": 15000,
"creditor": {
"routingNumber": "011000138",
"accountNumber": "456789000",
"name": "Cleveland Brown",
"addressStreetName": "Spooner St",
"addressBuildingNumber": "34",
"addressCity": "Quahog",
"addressState": "RI",
"addressPostalCode": "00093",
"addressCountry": "US"
"addressCountry": "US"
},
"queuedPaymentExpiresAt": "2023-02-19T08:22:17.512Z"
}Define an expiration time in seconds (queuedPaymentExpiresAfterInSeconds)
- Use the queuedPaymentExpiresAfterInSeconds attribute in your payment request.
- Enter the value in seconds (whole number).
- The countdown starts when the payment is queued.
- A value of 0 cancels the payment immediately if the RDFI is offline.
- For reference, the sample request includes this attribute on row 17.
POST /v1/payments
{
"accountNumber": "2553179843",
"amount": 15000,
"creditor": {
"routingNumber": "011000138",
"accountNumber": "456789000",
"name": "Cleveland Brown",
"addressStreetName": "Spooner St",
"addressBuildingNumber": "34",
"addressCity": "Quahog",
"addressState": "RI",
"addressPostalCode": "00093",
"addressCountry": "US"
"addressCountry": "US"
},
"queuedPaymentExpiresAfterInSeconds": 3600
}Cancel a queued payment
Cancel a queued payment anytime using thePOST /v1/payments/{paymentId}/cancel endpoint.
Test queuing in sandbox
To simulate offline participants, three participants alternate between online and offline every 60 minutes.
- Register for the Rtp.Payment.Queued and Rtp.Payment.Canceled webhook events.
- Submit a payment using one of the following routing numbers:
- 000000010
- 000000017
- 244084264
- If the participant is offline, the Rtp.Payment.Queued webhook fires, and the payment status changes to Queued.
- Once the participant returns online, the payment resumes normal processing.
If the payment isn’t queued, continue submitting until the participant cycles offline.