Create a payment link
Creates a reusable payment link. If productId is supplied, fields default from the product; explicit values always win. Returns 201 with the new link.
Authorization
apiKey AuthorizationBearer <token>
BAGS Agent API key from the dashboard. Standalone agentic keys manage products, payment links, and transaction reads.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
curl -X POST "https://www.getbags.app/api/v1/payment-links" \ -H "Content-Type: application/json" \ -d '{ "network": "base" }'{
"status": "success",
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"productId": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
"name": "Pro Plan",
"description": "Monthly access to premium features",
"amount": 29.99,
"currency": "USD",
"network": "base",
"networks": [
"base",
"ethereum"
],
"token": "USDC",
"active": true,
"mode": "live",
"livemode": true,
"pricingType": "one_time",
"billingInterval": null,
"billingIntervalCount": null,
"trialDays": null,
"merchantWalletAddress": "0x1111111111111111111111111111111111111111",
"merchantId": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
"merchantWalletAddresses": {
"base": "0x1111111111111111111111111111111111111111"
},
"merchantName": "Acme Corp",
"totalCollected": 0,
"totalTransactions": 0,
"customFields": [],
"isAgenticProxy": false,
"targetUrl": null,
"targetMethod": null,
"x402Scheme": "exact",
"inputSchema": null,
"inputExample": null,
"successUrl": "https://example.com/success",
"returnUrl": "https://example.com/return",
"cancelUrl": "https://example.com/cancel",
"createdAt": "2026-04-16T12:34:56.000Z",
"updatedAt": "2026-04-16T12:34:56.000Z"
}
}{
"status": "error",
"code": "VALIDATION_FAILED",
"message": "One or more fields failed validation."
}{
"status": "error",
"code": "AUTH_MISSING_CREDENTIALS",
"message": "No API key or session token was provided.",
"hint": "Include a valid API key in the Authorization header: Bearer bag_live_sk_..."
}{
"status": "error",
"code": "AUTH_TENANT_MISMATCH",
"message": "The credential does not grant access to this resource."
}{
"status": "error",
"code": "NOT_FOUND",
"message": "The requested resource was not found."
}{
"status": "error",
"code": "TRANSACTION_CHAIN_VERIFY_FAILED",
"message": "On-chain verification failed for the supplied txHash."
}{
"status": "error",
"code": "RATE_LIMITED",
"message": "Too many requests. Back off and retry.",
"retryAfter": 60
}{
"status": "error",
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred. The incident has been logged."
}