Create Payment Link

This API allows partners to create a payment link for a given merchant ID, which allows the payer to pay by clicking on the link using card or ACH.

POST https://<PayEngine-host>/api/payment-link

Request

Request Body

Name
Type
Description

merchant_id*

string

Merchant ID

data.payment_methods

array

Accepted values - CC_DC, ACH This field determine what payment methods option will be displayed to the user while paying. Default will be both values. CC_DC - stands for Credit Card and Debit Card ACH - Bank transfer

data.use_same_amount

boolean

  • True: The payment amount remains the same regardless of whether the user pays via Credit Card or ACH.

  • False: The payment amount varies depending on the payment method selected.

  • Default value: True.

data.amount

string

Max Length=12 Allowed characters: 0-9 and .(dot) Payment Link amount

Note:

  • This field is mandatory only if data.use_same_amount is true

  • this value always reflects the total dollar amount for example 1.00 and 1 both will be considered $1.00 and 0.10 will be 10 cents.

data.cc_amount

string

Payment Link amount for Credit Card users

Note:

  • This field is mandatory only if data.use_same_amount is false

  • this value always reflects the total dollar amount for example 1.00 and 1 both will be considered $1.00 and 0.10 will be 10 cents.

data.cc_amount_note

string

An optional field to provide a note or explanation for the payment amount specific to Credit Card users.

This note appears alongside the cc_amount in the payment link, if provided.

data.ach_amount

string

Payment Link amount for ACH users

Note:

  • This field is mandatory only if data.use_same_amount is false

  • this value always reflects the total dollar amount for example 1.00 and 1 both will be considered $1.00 and 0.10 will be 10 cents.

data.ach_amount_note

string

An optional field to provide a note or explanation for the payment amount specific to ACH users.

This note appears alongside the ach_amount in the payment link, if provided.

data.one_time_only

boolean

True | False.

  • True: The payment link can only be used for one successful payment (default)

  • False: The payment link can be used for multiple successful payments.

data.start_date

string

Payment link will be active starting this date. If not provided the payment link will activate immediately.

data.end_date

string

Payment link will become INACTIVE after this date. If not provided the payment link will remain ACTIVE until cancelled.

data.description

string

Description of payment link

data.order_number

string

Order or Invoice number.

Alphanumeric (a-z A-Z 0-9) maximum 20 characters

data.sales_tax

string

Sales tax included in the amount

data.currency_code

string

ISO Currency code If not provided it defaults to US Dollar (USD)

data.save_card_consent

boolean

True | False.

  • True - Display the field to get user's consent to use the same payment details for future payments

data.enable_captcha

boolean

An optional field to enable CAPTCHA functionality on the payment link.

  • Default value: False.

  • If true: reCAPTCHA v3 will be enabled. This operates silently in the background and does not interrupt users, ensuring that it does not affect conversion rates.

data.slug_id

string

Slug text for the generated payment page URL. By default, it is auto-generated. This slug text has to be unique in PayEngine environment

data.internal_transaction_id

string

An internal ID from integrating system. Will be returned in the response. Note: This ID won't be displayed in the payment link

data.metadata

object

Add any additional metadata by passing a json object

Field Name
Type
Description
Required?

payment_link_id

string

PayEngine system ID for the Payment Link

Required

payment_link_url

string

Payment Link URL

Required

qr_code_url

string

Payment Link QR Code URL

Required

payment_link_status

string

ACTIVE, INACTIVE, COMPLETED, CANCELLED

Required

merchant_id

string

Merchant ID

Required

start_date

string

Start date of Payment Link

optional

end_date

string

End date of Payment Link

Optional

amount

string

Amount charged at every transaction

Required

currency_code

string

ISO Currency code If not provided it defaults to US Dollar (USD)

Optional

payment_methods

array

Accepted values - CC_DC, ACH

Optional

sales_tax

string

Sales tax included in the amount

Optional

order_number

string

Order or Invoice number.

Alphanumeric (a-z A-Z 0-9) maximum 20 characters

Optional

description

string

Description of Payment Link

Optional

created_at

timestamp

Payment Link creation date

Required

updated_at

timestamp

Payment Link updated at

Required

metadata

object

Returns all the metadata sent in the request

Optional

internal_transaction_id

string

An internal ID from integrating system. Will be returned in the response if provided.

Optional

{
    "merchant_id": "1cc7b594-b80f-4227-a0fa-299c4c6ce8ab",
    "data": {    
        "amount": 12.50,        
        "currency_code": "USD",
        "payment_methods": ["CC_DC","ACH"],
        "sales_tax": 2.50,
        "order_number": "A350",
        "start_date": "20220510",
        "end_date": "20221115",
        "description": "A coffee cup in the morning",
        "save_card_consent": true,
        "internal_transaction_id": "ID1",
        "metadata": {
            "customer_id": "123",
            "email": "[email protected]"
        }
    }
}

Webhook event: PAYMENTLINK_CREATED

Webhook Payload Example

{
  event_uid: '4d304a4ed5a4e338b4753ab832efd9c0',
  event: 'PAYMENTLINK_CREATED',
  data: {
    payment_link_id: 'wlx57',
    payment_url: <payment link url>,
    qr_code_url: <qr code url>,
    payment_link_status: 'ACTIVE',
    merchant_id: 'c404d923-226f-4aae-92da-22c1ef370434',
    start_date: <start timestamp>,
    end_date: <end timestamp>,
    amount: '150.00',
    description: 'Payment for invoice #45324',
    internal_transaction_id: "ID1",
    metadata: {
            customer_id: "123",
            email: "[email protected]"
    }
  }
}

Last updated