PayAgency Logo
PaymentLink

Payment Link API

The Payment Link API allows users to create encrypted payment links with optional parameters like amount, currency, expiry date, and terminal. It returns a secure URL that customers can use to make payments.


API Endpoint

POST https://backend.pay.agency/api/v1/payment-link

Request Body Parameters

ParameterTypeRequiredDescription
payment_template_idStringYesID of the payment template to use for this link. *
amountNumberNoPayment amount.
currencyStringNoCurrency code (e.g., USD, INR).
expiry_dateStringNoExpiry date must be in yyyy-mm-dd format.
terminal_idStringNoTerminal ID to route the transaction through a specific connector. *
order_idStringNoUnique order from merchant side

Note: Parameters marked with * (payment_template_id and terminal_id) should not be sent when using a Test key.


Headers

Header NameDescription
Content-TypeSet to application/json.
AuthorizationBearer token (your Secret key or Test key).

Environment Behavior

The behavior of the API response depends on the type of key used in the Authorization header:

  • If the Test key is passed, a test payment link will be generated.
  • If the Live key is passed, a live payment link will be generated.

This allows you to safely test integrations before going live.


Success Response

If the payment link is created successfully, the API returns the secure link:

{
  "message": "Payment link created successfully.",
  "data": "https://portal.pay.agency/pay/PAY_LINK_88331144264007292"
}

Error Response

{
  "message": "Invalid Payment Template ID or Connector Terminal ID."
}

On this page