Products
Manage your product catalog for payment links and checkout sessions
Products represent items or services in your catalog. Each product defines pricing, token, and chain configuration that can be reused across multiple payment links and checkout sessions.
Products support three pricing types: one_time for single purchases, subscription for recurring payments, and variable for customer-chosen amounts.
The Product object
Unique identifier for the product (e.g., prod_abc123).
Product name displayed to customers.
Price in the token's smallest unit. Null for variable product types.
Contract address of the token for pricing.
Chain ID for the pricing token.
Product description.
Product image URL.
Default wallet address that receives payments for this product.
Pricing type: one_time, subscription, or variable.
Arbitrary key-value pairs for your own use. Not displayed to customers.
Custom form fields to collect during checkout. Same structure as Payment Links form_schema.
Shipping options for physical goods. Same structure as Payment Links shipping_options.
Whether the product is active. Inactive products cannot be used in new payment links.
ISO 8601 creation timestamp.
ISO 8601 last update timestamp.
List products
Retrieve a paginated list of your products.
Page number for pagination.
Number of results per page (max 100).
Filter by active status. Omit to return all products.
curl -X GET "https://platform-api.anyspend.com/api/v1/products?page=1&limit=20" \
-H "Authorization: Bearer asp_xxx"import { AnySpend } from "@b3dotfun/sdk";
const anyspend = new AnySpend(process.env.ANYSPEND_API_KEY!);
const { data, pagination } = await anyspend.products.list({
page: 1,
limit: 20,
});json{ "data": [ { "id": "prod_abc123", "name": "Pro Plan", "amount": "50000000", "token_address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "chain_id": 1, "description": "Professional tier with unlimited access", "image_url": "https://example.com/pro.png", "recipient_address": "0x1234...abcd", "product_type": "one_time", "metadata": { "sku": "PRO-001", "internal_id": "tier_3" }, "form_schema": null, "shipping_options": null, "active": true, "created_at": "2026-01-10T09:00:00Z", "updated_at": "2026-02-15T12:00:00Z" }, { "id": "prod_def456", "name": "Donation", "amount": null, "token_address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "chain_id": 1, "description": "Support our project with any amount", "image_url": null, "recipient_address": "0x1234...abcd", "product_type": "variable", "metadata": null, "form_schema": null, "shipping_options": null, "active": true, "created_at": "2026-01-20T14:30:00Z", "updated_at": "2026-01-20T14:30:00Z" } ], "pagination": { "page": 1, "limit": 20, "total": 2, "total_pages": 1, "has_more": false } }
Create a product
Product name.
Contract address of the token for pricing.
Chain ID for the pricing token.
Default wallet address that receives payments.
Pricing type. One of: one_time, subscription, variable.
Price in the token's smallest unit. Required for one_time and subscription types.
Product description.
Product image URL.
Arbitrary key-value pairs (e.g., {"sku": "PRO-001"}). Up to 50 keys, 500 character values.
Custom form fields to collect during checkout.
Shipping options for physical goods.
curl -X POST "https://platform-api.anyspend.com/api/v1/products" \
-H "Authorization: Bearer asp_xxx" \
-H "Content-Type: application/json" \
-d '{
"name": "Pro Plan",
"amount": "50000000",
"token_address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"chain_id": 1,
"recipient_address": "0x1234567890abcdef1234567890abcdef12345678",
"product_type": "one_time",
"description": "Professional tier with unlimited access",
"image_url": "https://example.com/pro.png",
"metadata": {
"sku": "PRO-001",
"internal_id": "tier_3"
}
}'const product = await anyspend.products.create({
name: "Pro Plan",
amount: "50000000",
tokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
chainId: 1,
recipientAddress: "0x1234567890abcdef1234567890abcdef12345678",
productType: "one_time",
description: "Professional tier with unlimited access",
imageUrl: "https://example.com/pro.png",
metadata: {
sku: "PRO-001",
internal_id: "tier_3",
},
});json{ "id": "prod_abc123", "name": "Pro Plan", "amount": "50000000", "token_address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "chain_id": 1, "description": "Professional tier with unlimited access", "image_url": "https://example.com/pro.png", "recipient_address": "0x1234567890abcdef1234567890abcdef12345678", "product_type": "one_time", "metadata": { "sku": "PRO-001", "internal_id": "tier_3" }, "form_schema": null, "shipping_options": null, "active": true, "created_at": "2026-02-27T10:00:00Z", "updated_at": "2026-02-27T10:00:00Z" }
Retrieve a product
The product ID (e.g., prod_abc123).
curl -X GET "https://platform-api.anyspend.com/api/v1/products/prod_abc123" \
-H "Authorization: Bearer asp_xxx"const product = await anyspend.products.retrieve("prod_abc123");Returns the full Product object.
Update a product
Update an existing product. Only the fields you include in the request body will be updated.
The product ID.
All body parameters from the create endpoint are accepted. Additionally:
Set to false to deactivate the product.
Updating a product does not retroactively update payment links that were created from it. Each payment link maintains its own configuration.
curl -X PATCH "https://platform-api.anyspend.com/api/v1/products/prod_abc123" \
-H "Authorization: Bearer asp_xxx" \
-H "Content-Type: application/json" \
-d '{
"name": "Pro Plan (Annual)",
"amount": "500000000",
"description": "Professional tier - annual billing"
}'const updated = await anyspend.products.update("prod_abc123", {
name: "Pro Plan (Annual)",
amount: "500000000",
description: "Professional tier - annual billing",
});Returns the updated Product object.
Delete a product
Soft-delete a product. The product will be marked as inactive and will no longer appear in list results by default. Existing payment links using this product will continue to function.
The product ID.
Deleting a product is a soft delete. The product data is preserved for historical reference in existing transactions and payment links.
curl -X DELETE "https://platform-api.anyspend.com/api/v1/products/prod_abc123" \
-H "Authorization: Bearer asp_xxx"await anyspend.products.delete("prod_abc123");json{ "id": "prod_abc123", "deleted": true }
Generate a payment link from a product
Automatically create a payment link pre-configured with the product's settings. This is a convenience method that creates a new payment link using the product's name, amount, token_address, chain_id, recipient_address, description, image_url, form_schema, and shipping_options.
The product ID.
Override the payment link name. Defaults to the product name.
URL to redirect customers after payment.
Maximum number of uses for the generated link.
ISO 8601 expiration timestamp for the generated link.
Any additional payment link fields can be passed as overrides.
curl -X POST "https://platform-api.anyspend.com/api/v1/products/prod_abc123/generate-link" \
-H "Authorization: Bearer asp_xxx" \
-H "Content-Type: application/json" \
-d '{
"return_url": "https://example.com/thank-you",
"max_uses": 100,
"expires_at": "2026-12-31T23:59:59Z"
}'const paymentLink = await anyspend.products.generateLink("prod_abc123", {
returnUrl: "https://example.com/thank-you",
maxUses: 100,
expiresAt: "2026-12-31T23:59:59Z",
});Returns a new Payment Link object with product_id set to the source product.
json{ "id": "pl_newlink789", "name": "Pro Plan", "url": "https://anyspend.com/pay/pl_newlink789", "short_url": "https://as.pay/newlink789", "token_address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "chain_id": 1, "recipient_address": "0x1234567890abcdef1234567890abcdef12345678", "amount": "50000000", "description": "Professional tier with unlimited access", "product_id": "prod_abc123", "image_url": "https://example.com/pro.png", "max_uses": 100, "uses": 0, "expires_at": "2026-12-31T23:59:59Z", "active": true, "return_url": "https://example.com/thank-you", "created_at": "2026-02-27T10:15:00Z", "updated_at": "2026-02-27T10:15:00Z" }