Creating payment link

POST /api/public/v1/payment_links

This endpoint creates payment links.

Headers

Name
Value

Content-Type

application/vnd.api+json

Authorization

Bearer <api_key>

Request Body

Name
Type
Required
Description

data.type

string

Yes

Can only be payment_links.

data.attributes.amount

string

Yes

Payment amount to display to end users.

data.attributes.currency

string

Yes

Payment currency to display to end users. Refer to supported currencies.

data.attributes.accountCurrency

string

No

Specifies the merchant account to be used for crediting invoice payments or debiting payout amounts.

data.attributes.paymentType

string

Yes

Payment type. Can be either Invoice or Payout.

data.attributes.reference

string

No

The custom reference ID to tie the payment to end-user. This can be anything you choose. Must be a unique value for each payment you create.

data.attributes.expires_at

string

Yes

Payment link expiration date and time. Follow the format 2025-01-12T23:00:00.000Z

cURL

curl -X "POST" "https://api.sandbox.txn.pro/api/public/v1/payment_links" \
     -H 'Content-Type: application/vnd.api+json' \
     -H 'Authorization: Bearer ' \
     -d $'{
  "data": {
    "type": "payment_links",
    "attributes": {
      "amount": "100",
      "currency": "EUR",
      "reference": "8c40d8b6-ccdf-4861-a6d6-6c3125ce3f31",
      "expires_at": "2025-01-12T23:00:00.000Z",
      "paymentType": "Payout"
    }
  }
}'

Response Body

Name
Type
Description

data.id

string

Payment link ID.

data.type

string

Entity type returned. Always paymentLinks.

data.attributes

object

Set of payment attributes.

data.attributes.amount

string

Payment amount to display to end users.

data.attributes.currency

string

Payment currency to display to end users. Refer to Supported currencies.

data.attributes.network

string

Payment network code. E.g. trx:usdt. Refer to Supported currencies.

data.attributes.networkName

string

Payment network name. E.g. Tron (TRC20). Refer to Supported currencies.

data.attributes.reference

string

The custom reference ID to tie the payment to end-user.

data.attributes.hostedPageUrl

The payment hosted page URL to redirect your end-users to.

data.attributes.status

string

Payment link status context. Can be created, pending, completed, expired.

data.attributes.network

string

Network code. Refer to Supported currencies.

data.attributes.expiresAt

string

Payment link expiry date and time.

data.attributes.createdAt

string

Date and time payment was created at.

data.relationships.target

object

This object will contain ID of the child Invoice or Payout generated by the Payment Link.

included

array

This array will contain data about the child Invoice or Payout generated by the Payment Link. For more details refer to Invoice and Payout pyaloads.

Response

{
  "data": {
    "id": "1e1a0c1b-4af0-4e3d-ae87-e31776a60a2c",
    "type": "paymentLinks",
    "attributes": {
      "amount": "100.00",
      "currency": "EUR",
      "network": null,
      "networkName": null,
      "reference": "8c40d8b6-ccdf-4861-a6d6-6c3125ce3f31",
      "hostedPageUrl": "https://sandbox.txn.pro/redirect?payment_link_id=1e1a0c1b-4af0-4e3d-ae87-e31776a60a2c\u0026request_type=payment_link_hosted_page",
      "status": "created",
      "expiresAt": "2025-01-12T23:00:00.000Z",
      "createdAt": "2025-01-12T07:44:19.246Z",
      "paymentType": "Payout"
    },
    "relationships": {
      "target": {
        "data": null
      }
    }
  },
  "meta": {},
  "jsonapi": {
    "version": "1.0"
  }
}

Last updated