Wallgent
Guides

Customers & Payment Links

Manage customer records, save payment methods, and create shareable payment links.

Customers

Customers represent the people or businesses your agents bill. Create a customer to send invoices, save payment methods, and track billing history.

Create a Customer

POST /v1/customers

Request Body

FieldTypeRequiredDescription
emailstringYesCustomer email (must be unique per org)
namestringYesCustomer name
phonestringNoPhone number
companyNamestringNoCompany name
metadataobjectNoCustom key-value data
const customer = await wg.customers.create({
  email: 'jane@acme.com',
  name: 'Jane Smith',
  companyName: 'Acme Corp',
});
// customer.id: "cus_01J..."

List Customers

GET /v1/customers

Get Customer

GET /v1/customers/:id

Update Customer

PATCH /v1/customers/:id

Update name, phone, companyName, or metadata.


Payment Methods

Save a customer's payment method for future charges.

Setup Payment Method

POST /v1/customers/:id/payment-methods/setup

Returns a Stripe-hosted URL where the customer can securely add their card or bank account.

const setup = await wg.customers.setupPaymentMethod('cus_01J...');
// setup.url: "https://checkout.stripe.com/..."

List Payment Methods

GET /v1/customers/:id/payment-methods

Remove Payment Method

DELETE /v1/customers/:id/payment-methods/:pmId

Get Payment Update URL

POST /v1/customers/:id/payment-update-url

Generate a URL for the customer to update their existing payment method.


Payment links let your agents send money to anyone without needing the recipient's bank details upfront. Create a link, share the URL, and the recipient chooses how to claim the funds.

POST /v1/payment-links

Request Body

FieldTypeRequiredDescription
walletIdstringYesWallet funding the link
amountstringYesAmount to send
currencystringNoUSD or USDC (default: USD)
descriptionstringNoDescription (max 1024 chars)
recipientRestrictionsobjectNoLimit who can claim
expiresAtstringNoISO 8601 expiry date
metadataobjectNoCustom key-value data

Recipient Restrictions

FieldTypeDescription
emailsstring[]Only these emails can claim
walletIdsstring[]Only these wallets can claim
const link = await wg.paymentLinks.create({
  walletId: 'wal_01J...',
  amount: '250.00',
  description: 'Freelance payment for design work',
  expiresAt: '2026-03-01T00:00:00Z',
});
// link.slug: "abc123"
// link.url: "https://wallgent.com/pay/abc123"
GET /v1/payment-links?walletId=...&status=...&limit=20
PATCH /v1/payment-links/:id

Cancels the link and releases held funds back to the wallet.


These routes require no authentication. Recipients use them to claim funds.

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

Request Body

FieldTypeRequiredDescription
methodstringYesach, usdc, or wallet
destinationobjectYesWhere to send funds
recipientEmailstringNoRecipient email (for restricted links)

ACH Destination

{
  "method": "ach",
  "destination": {
    "type": "ACH",
    "routingNumber": "021000021",
    "accountNumber": "123456789"
  }
}

USDC Destination

{
  "method": "usdc",
  "destination": {
    "type": "USDC",
    "address": "0x..."
  }
}

Wallet Destination

{
  "method": "wallet",
  "destination": {
    "type": "WALLET",
    "walletId": "wal_01J..."
  }
}

ACTIVE → CLAIMED → SETTLED
       → EXPIRED
       → CANCELLED

Webhook Events

Customer Events

EventDescription
customer.createdCustomer was created
customer.updatedCustomer details changed
customer.payment_method.savedPayment method saved
customer.payment_method.updatedPayment method updated
customer.payment_method.removedPayment method removed
EventDescription
payment_link.createdLink created
payment_link.claimedRecipient claimed the link
payment_link.settledFunds settled to recipient
payment_link.expiredLink expired unclaimed
payment_link.cancelledLink was cancelled

MCP Tools

ToolDescription
wallgent_create_customerCreate a customer record
wallgent_list_customersList all customers
wallgent_create_payment_linkCreate a payment link
wallgent_list_payment_linksList payment links
wallgent_cancel_payment_linkCancel a payment link

Permissions

PermissionRequired For
invoices:writeCreate/update customers, setup payment methods
invoices:readList customers and payment methods
payments:writeCreate/cancel payment links
payments:readList payment links

On this page