POST /payment-links

Authentication

Bearer Token API Key (header: X-API-Key)

Header Parameters

Idempotency-Key string optional header
Unique key for idempotent requests (24h TTL)

Request Body required

application/json
name string REQUIRED
description string
amount string
token_address string REQUIRED
chain_id integer REQUIRED
recipient_address string REQUIRED
items object[]
Array of:
name string
amount string
quantity integer
form_schema object
shipping_options array
branding object
max_uses integer
expires_at integer
return_url string
fee_on_top boolean

Responses

201 Payment link created

No response body

curl -X POST 'https://platform-api.anyspend.com/api/v1/payment-links' \  -H 'Authorization: Bearer YOUR_API_TOKEN' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "description": "string",  "amount": "string",  "token_address": "string",  "chain_id": 0,  "recipient_address": "string",  "items": [    {      "name": "string",      "amount": "string",      "quantity": 0    }  ],  "form_schema": {},  "shipping_options": [],  "branding": {},  "max_uses": 0,  "expires_at": 0,  "return_url": "string",  "fee_on_top": true}'
const response = await fetch('https://platform-api.anyspend.com/api/v1/payment-links', {  method: 'POST',  headers: {      "Authorization": "Bearer YOUR_API_TOKEN",      "Content-Type": "application/json"  },  body: JSON.stringify({    "name": "string",    "description": "string",    "amount": "string",    "token_address": "string",    "chain_id": 0,    "recipient_address": "string",    "items": [      {        "name": "string",        "amount": "string",        "quantity": 0      }    ],    "form_schema": {},    "shipping_options": [],    "branding": {},    "max_uses": 0,    "expires_at": 0,    "return_url": "string",    "fee_on_top": true  })});const data = await response.json();console.log(data);
import requestsheaders = {    'Authorization': 'Bearer YOUR_API_TOKEN'}response = requests.post('https://platform-api.anyspend.com/api/v1/payment-links', headers=headers, json={  "name": "string",  "description": "string",  "amount": "string",  "token_address": "string",  "chain_id": 0,  "recipient_address": "string",  "items": [    {      "name": "string",      "amount": "string",      "quantity": 0    }  ],  "form_schema": {},  "shipping_options": [],  "branding": {},  "max_uses": 0,  "expires_at": 0,  "return_url": "string",  "fee_on_top": true})print(response.json())