Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Payment Request

Payment request is an advanced version of Pay By Link that allows you to generate secure, authenticated payment links via API. Unlike Pay By Link, which is manually triggered from the payment page, payment requests are generated with a server-to-server API call. This is perfect for use cases like remote service billing and debt collection.

Payment requests require customers to verify their identity using a one-time password (OTP) sent to their mobile phone before they can access the payment page.

You have a choice between two ways of distributing payment requests:

  1. Use Hyp's infrastructure to send payment requests via SMS.

  2. Distribute payment requests through your own channels (email, customer portal, etc.).

While both methods allow you to send payment links to customers, they differ in their security requirements and how they are initiated:

  • Interaction: Pay By Link involves two people interacting with a payment page: first, the requester generates the link, then the recipient uses it to pay. Payment requests are generated via a server-side API call, and interaction with a payment page only occurs on the recipient's end.

  • Verification: Payment links generated with Pay By Link are ready to use immediately without additional verification. In contrast, payment requests require the recipient to verify their identity with a one-time password (OTP).

Prerequisites

Before you can start generating payment requests, you need to:

  1. Contact Hyp support: Have the payment request service enabled and configured on your terminal. This includes setting the merchant name and branding that will appear in SMS messages.

  2. Set up a webhook endpoint: Hyp sends transaction status updates to your server via webhooks.

Payment experience

First, the customer receives an SMS notification containing a secure payment link and a short description of the charge. (Alternatively, if you have chosen to use your own channels for distributing the link, you can send the link to the customer directly.)

SMS

When the customer clicks the link, they see the message sent by the merchant in the payment request and are prompted to request a verification code. When they do, Hyp sends a 6-digit OTP to the customer's mobile number.

OTP request page

After entering the correct OTP, the customer is granted access to the payment page, where they can complete the transaction using any supported payment method:

Payment Page

When the payment is successful, the customer is redirected to a success page, and your system is notified via a webhook.

Integration

To create a payment request, send a doDeal request with the validation parameter set to apiPaymentLinkSetup.

The following are the mandatory parameters that you should include in the request:

  • cardHolderPhoneNo: the customer's mobile number for SMS delivery and OTP authentication.

  • linkExpiration (inside apiLinkData): sets the generated payment link to expire anywhere from 1 to 240 hours (10 days). After this period, the customer will no longer be able to access the OTP or payment page.

  • sendLinkByHyp (inside apiLinkData): 1 delegates delivery of the payment link via SMS to Hyp. If set to 0, you, as the merchant, are responsible for delivering the payment link through your own channels (e.g., via WhatsApp or your own email system).

  • linkMerchantText (inside apiLinkData): the text explaining the reason for the payment request that the customer sees during the OTP verification step.

The mpiValidation parameter in a payment request can only be set to Verify, AutoComm, or AutoCommHold.

For a full list of available parameters and their formats, see the doDeal API reference.

Example request

Here's a sample API request to create a payment request:

View sample request

Example response

If the request is successful, Hyp returns a response with status 000 that contains an apiLinkData section wrapping payment link information, including:

  • linkUrl: The payment link that the customer will use. This link is sent to the customer if you've chosen SMS delivery. Otherwise, you're responsible for distributing it through your own channels.

  • linkId: An alphanumeric identifier that you should store for reconciliation and cross-referencing with webhook responses.

  • linkStatus: Set to Created; during the lifecycle of a payment request, the status may change to either Success or Rejected.

View sample response

Make sure to save the tranId supplied in the response in case you want to cancel the payment request later.

Handling results and reconciliation

Once the customer completes a payment, you can handle the payment completion redirect as usual, including saving cgUid for future reference and reconciliation.

In addition, Hyp sends two types of notifications to your webhook endpoint:

  1. Link status notification (J112): This notification (transaction type TxnNotification) tells you that the link status has changed (e.g., from Created to Success). Inside the notification, look for the apiLinkData section that conveys the new status of the payment request.

  2. Transaction notification (J4): This is the standard transaction completion notification containing the payment processing outcome, payment details, authorization codes, and card information.

View sample J112 notification

Cancelling an unpaid payment request

Since you can't change the parameters of an existing request, you need to create a new one if you want to update the total due, phone number, or the text accompanying the payment link. When you create a new corrected request, you should cancel the previous one.

If a payment link hasn't been used yet, you can cancel it using the cancelPaymentLink command and the tranId returned when you created the link:

Error handling

If there's an issue with generating a payment request, Hyp will return an error code. Here are the most common validation errors:

Error text
Status code
Description

Missing mandatory field in XML

322

One or more of the following mandatory parameters are not set: cardHolderPhoneNo, linkMerchantText, linkExpiration, or sendLinkByHyp

MPI Invalid request or post parameters

683

The mpiValidation parameter is set to an unsupported value. Supported values are Verify, AutoComm, and AutoCommHold

A payment request can be successfully created but still end up unpaid for several reasons, as detailed in the following table. The status code will be returned in the link status notification (TxnNotification, J112) with the linkStatus property set to Rejected.

Error text
Status code
Description

OTP check failed

382

The customer exhausted the number of attempts to enter a valid OTP code

Maximum OTP request exceeded

384

The customer exhausted the allowed number of OTP SMS resend attempts

Payment request has expired

487

The customer did not open the payment request or did not complete the payment

Error code from last debit attempt

The customer exhausted the number of payment attempts with a credit card

Last updated

Was this helpful?