Payment Requests

Payment requests provide a seamless process to receive payments from the different payment providers Asyncpay supports.

A payment request contains all the information about a payment through out its life-cycle. When a user tries to make a payment through Asyncpay, a payment request is created and then goes through different stages.

After a payment request is created, Asyncpay relays that payment through a payment channel. A payment request can be relayed to as many payment channels as necessary to complete a payment but it expires after twenty four hours.

You can always view a list of all payment requests in your dashboard as well as every payment channel that the payment request passed through until it a successful payment has been verified or it expires after twenty four hours.

Creating a payment request

A payment request can either be created with our checkout SDK or with our APIs. Feel free to explore our Javascript SDK here, and our Postman collection here.

When a checkout is created via the JavaScript SDK, a payment request is created behind the scenes and relayed to the payment channel a user chooses at the point of checkout.

Payment requests can be viewed either on the Asyncpay dashboard or by using the Asynpay APIs.

Relaying a payment request

A payment request can be initiated through a payment channel, allowing multiple relay attempts until a successful and verified transaction is achieved. Businesses can utilize the universal checkout, where users select a payment channel, or the API for this purpose.

Payment Request Statuses

A payment request has a few statuses that signifies the point a payment request is in its lifecycle. Payment requests can either be viewed on the dashboard or via the API. This is a list of the possible statuses of a payment request and what they signify.

  • new- This means the payment request was newly created and is not available to be relayed to payment channels. You'll rarely ever see a payment request in this status as it switches instantaneously once its initial setup is complete.

  • open- This means the payment request is available to be relayed to a payment channel. A payment request remains in this mode until a transaction is successfully completed with a payment channel

  • awaiting_verification - This means a transaction has been successfully completed with this payment request. Once a payment request awaiting verification, it can no longer be relayed to any other payment channels. It remains in this mode until Asyncpay completes its verification on that transaction, and if it's successful, Asyncpay sends out the relevant webhooks.

  • successful - A payment request becomes successful after Asyncpay verifies the successful transaction.

  • expired - If no successful transaction is made on a payment request within 24 hours, Asyncpay expires the transaction and no more payment attempts can be made on that payment request.

After the payment

Asyncpay employs webhooks to notify about significant events in a payment request's lifecycle. Once a payment request is completed and verified, Asyncpay sends a payment_request.verified webhook. For more details on all webhooks provided by Asyncpay, check here.

After receiving the webhook, value can be granted to the user. The alternative could be to poll the payment request retrieval endpoint and check if the payment request has a status of successful.

Upon receiving the payment_request.verified webhook, the user can be promptly granted the appropriate value. Alternatively, the payment request retrieval endpoint can be polled to check if the payment request status is successful.

Last updated