> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anyspend.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 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

**id**

Unique identifier for the product (e.g., `prod_abc123`).

**name**

Product name displayed to customers.

**amount**

Price in the token's smallest unit. Null for `variable` product types.

**token_address**

Contract address of the token for pricing.

**chain_id**

Chain ID for the pricing token.

**description**

Product description.

**image_url**

Product image URL.

**recipient_address**

Default wallet address that receives payments for this product.

**product_type**

Pricing type: `one_time`, `subscription`, or `variable`.

**metadata**

Arbitrary key-value pairs for your own use. Not displayed to customers.

**form_schema**

Custom form fields to collect during checkout. Same structure as [Payment Links form_schema](/anyspend/api/payment-links#the-payment-link-object).

**shipping_options**

Shipping options for physical goods. Same structure as [Payment Links shipping_options](/anyspend/api/payment-links#the-payment-link-object).

**active**

Whether the product is active. Inactive products cannot be used in new payment links.

**created_at**

ISO 8601 creation timestamp.

**updated_at**

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.

```bash cURL
curl -X GET "https://platform-api.anyspend.com/api/v1/products?page=1&limit=20" \
  -H "Authorization: Bearer asp_xxx"
```

```typescript SDK
import { AnySpendPlatformClient } from "@b3dotfun/sdk/anyspend/platform";

const platform = new AnySpendPlatformClient(process.env.ANYSPEND_API_KEY!);

const { data, pagination } = await platform.products.list({
  page: 1,
  limit: 20,
});
```

**Response**

```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.

```bash cURL
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"
    }
  }'
```

```typescript SDK
const product = await platform.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",
  },
});
```

**Response**

```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`).

```bash cURL
curl -X GET "https://platform-api.anyspend.com/api/v1/products/prod_abc123" \
  -H "Authorization: Bearer asp_xxx"
```

```typescript SDK
const product = await platform.products.get("prod_abc123");
```

**Response**

Returns the full [Product object](#the-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](#create-a-product) 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.

```bash cURL
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"
  }'
```

```typescript SDK
const updated = await platform.products.update("prod_abc123", {
  name: "Pro Plan (Annual)",
  amount: "500000000",
  description: "Professional tier - annual billing",
});
```

**Response**

Returns the updated [Product object](#the-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.

```bash cURL
curl -X DELETE "https://platform-api.anyspend.com/api/v1/products/prod_abc123" \
  -H "Authorization: Bearer asp_xxx"
```

```typescript SDK
await platform.products.delete("prod_abc123");
```

**Response**

```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](/anyspend/api/payment-links#create-a-payment-link) can be passed as overrides.

```bash cURL
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"
  }'
```

```typescript SDK
const paymentLink = await platform.products.generateLink("prod_abc123", {
  returnUrl: "https://example.com/thank-you",
  maxUses: 100,
  expiresAt: "2026-12-31T23:59:59Z",
});
```

**Response**

Returns a new [Payment Link object](/anyspend/api/payment-links#the-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"
    }
    ```