Wallgent
Guides

Payment Links

Create shareable links for receiving payment — no invoice required.

Overview

Payment links are shareable URLs that let your AI agents receive money without creating a formal invoice. Generate a link, share it with the payer, and the payer claims it using their preferred payment method. Funds settle directly into the specified wallet.

Payment link lifecycle:

ACTIVE → CLAIMED
       → CANCELLED
       → EXPIRED

A link moves to CLAIMED once a payer completes the claim flow. Links move to EXPIRED automatically when the expiresAt timestamp passes.


POST /v1/payment-links

Request Body

FieldTypeRequiredDescription
walletIdstringYesWallet to receive the funds
amountstringYesAmount to collect (decimal string)
currencystringNoUSD or USDC (default: USD)
descriptionstringNoShown to the payer (max 1,024 chars)
recipientRestrictionsobjectNoRestrict who can claim the link
expiresAtstringNoISO 8601 expiry timestamp
metadataobjectNoCustom key-value data

Recipient Restrictions Object

FieldTypeDescription
emailsstring[]Only allow claims from these email addresses
walletIdsstring[]Only allow claims from these wallet IDs
import Wallgent from '@wallgent/sdk'

const wg = new Wallgent({ apiKey: process.env.WALLGENT_API_KEY })

const link = await wg.paymentLinks.create({
  walletId: 'wal_01J...',
  amount: '150.00',
  currency: 'USD',
  description: 'Payment for data analysis services',
  expiresAt: '2026-04-01T00:00:00Z',
})

console.log(link.slug)  // Share this slug — the payer uses it to claim
GET /v1/payment-links?walletId=...&status=...&limit=...

Filter by wallet, status, or limit the result count.

const { data } = await wg.paymentLinks.list({
  walletId: 'wal_01J...',
  status: 'ACTIVE',
  limit: 20,
})
PATCH /v1/payment-links/:id

Cancels an ACTIVE link. Once cancelled, it can no longer be claimed.

await wg.paymentLinks.cancel('lnk_01J...')

Claim Flow (Payer Side)

The claim flow is public — no API key is required. This lets you embed it in a web page or mobile app that the payer interacts with directly.

GET /v1/payment-links/claim/:slug

Returns the payment link details (amount, currency, description, status) so you can display them to the payer before they commit to paying.

const details = await wg.paymentLinks.getBySlug('abc123')
console.log(`Pay ${details.amount} ${details.currency} — ${details.description}`)
POST /v1/payment-links/claim/:slug/claim

The payer submits their chosen payment method and destination.

Claim Methods

MethodDescription
achPay via ACH bank transfer
usdcPay via USDC on-chain
walletPay from another Wallgent wallet

ACH Claim

const result = await wg.paymentLinks.claim('abc123', {
  method: 'ach',
  destination: {
    type: 'ACH',
    routingNumber: '021000021',
    accountNumber: '1234567890',
    accountName: 'Acme Corp',
  },
  recipientEmail: 'payer@example.com',
})

USDC Claim

const result = await wg.paymentLinks.claim('abc123', {
  method: 'usdc',
  destination: {
    type: 'USDC',
    address: '0xAbCd...',
    chain: 'ethereum',
  },
})

Wallet Claim

const result = await wg.paymentLinks.claim('abc123', {
  method: 'wallet',
  destination: {
    type: 'WALLET',
    walletId: 'wal_01J...',
  },
})

console.log(result.transactionId)  // txn_ ID for the resulting transfer

Statuses

StatusDescription
ACTIVELink is live and can be claimed
CLAIMEDPayer has completed the claim flow
CANCELLEDCreator cancelled the link
EXPIREDexpiresAt timestamp has passed

Webhook Events

EventDescription
payment_link.claimedA payer successfully claimed the link
payment_link.expiredLink passed its expiresAt without being claimed

API Endpoints

MethodPathDescription
POST/v1/payment-linksCreate a payment link
GET/v1/payment-linksList payment links
PATCH/v1/payment-links/:idCancel a payment link
GET/v1/payment-links/claim/:slugGet link details (public)
POST/v1/payment-links/claim/:slug/claimClaim a link (public)

Permissions

PermissionRequired For
payments:writeCreate and cancel payment links
payments:readList payment links

On this page