Docs

The Payment Link object

A payment link is a shareable URL that takes your customers to a hosted payment page. A payment link can be shared and used multiple times. When a customer opens a payment link, Zoneless creates a new Checkout Session to render the payment page. Use Checkout Session events such as checkout.session.completed to track payments made through payment links.

Attributes

id string

Unique identifier for the object. Zoneless Payment Link IDs are prefixed with plink_z_.

object string

String representing the object's type. Objects of the same type share the same value.

active boolean

Whether the payment link's url is active. If false, customers visiting the URL see a page saying that the link has been deactivated.

after_completion object

Behavior after the purchase is complete.

allow_promotion_codes boolean

Whether user redeemable promotion codes are enabled.

currency string

Three-letter ISO currency code, in lowercase. For Zoneless, this is usdc.

Difference from Stripe: Zoneless settles in USDC on Solana rather than fiat currencies.

line_itemsnullable object

The line items representing what is being sold. Expand this field with the expand request parameter, or retrieve them with the line items endpoint.

livemode boolean

If the object exists in live mode, the value is true. If the object exists in test mode, the value is false.

metadata object

Set of key-value pairs that you can attach to an object. Useful for storing additional information in a structured format.

payment_method_typesnullable array of strings

The list of payment method types that customers can use. When null, relevant payment methods enabled in your payment method settings are shown dynamically.

Difference from Stripe: Zoneless currently accepts crypto (USDC on Solana) rather than cards or other fiat rails.

url string

The public URL that can be shared with customers.

platform_account string

The platform account that owns this resource. For connected account resources, this is the platform's account ID. For the platform's own resources, this equals the account field (self-referential).

Zoneless extension: This field is not present in Stripe's API. It enables multi-tenant operation.

url_slug string

Opaque slug used in the public payment link URL (/b/{url_slug}). Distinct from id so shareable links do not expose the API object ID.

Zoneless extension: This field is not present in Stripe's API.

More attributes

THE PAYMENT LINK OBJECT
{
  "id": "plink_z_7nQ2wKpR9xVmHc4bYtLsJ8fA",
  "object": "payment_link",
  "active": true,
  "created": 1725123600,
  "after_completion": {
    "hosted_confirmation": {
      "custom_message": null
    },
    "redirect": null,
    "type": "hosted_confirmation"
  },
  "allow_promotion_codes": false,
  "application": null,
  "application_fee_amount": null,
  "application_fee_percent": null,
  "automatic_tax": {
    "enabled": false,
    "liability": null
  },
  "billing_address_collection": "auto",
  "consent_collection": null,
  "currency": "usdc",
  "custom_fields": [],
  "custom_text": {
    "after_submit": null,
    "shipping_address": null,
    "submit": null,
    "terms_of_service_acceptance": null
  },
  "customer_creation": "if_required",
  "inactive_message": null,
  "invoice_creation": {
    "enabled": false,
    "invoice_data": {
      "account_tax_ids": null,
      "custom_fields": null,
      "description": null,
      "footer": null,
      "issuer": null,
      "metadata": {},
      "rendering_options": null
    }
  },
  "livemode": false,
  "managed_payments": null,
  "metadata": {},
  "name_collection": null,
  "on_behalf_of": null,
  "optional_items": null,
  "payment_intent_data": null,
  "payment_method_collection": "always",
  "payment_method_options": null,
  "payment_method_types": [
    "crypto"
  ],
  "phone_number_collection": {
    "enabled": false
  },
  "restrictions": null,
  "shipping_address_collection": null,
  "shipping_options": [],
  "submit_type": "auto",
  "subscription_data": null,
  "tax_id_collection": {
    "enabled": false
  },
  "transfer_data": null,
  "url": "https://pay.yourdomain.com/b/n4k8m2p7q1",
  "url_slug": "n4k8m2p7q1",
  "platform_account": "acct_z_Platform123abc"
}

Create a payment link

Creates a payment link.

ENDPOINTS
POST /v1/payment_links

Parameters

line_items array of objects Required

The line items representing what is being sold. Up to 20 line items are supported.

after_completion object

Behavior after the purchase is complete.

allow_promotion_codes boolean

Enables user redeemable promotion codes.

currency string

Three-letter currency code, in lowercase. Must be supported by each line item's price. Defaults to usdc.

Difference from Stripe: Zoneless currently accepts only usdc.

metadata object

Set of key-value pairs that you can attach to an object. Metadata associated with this Payment Link is automatically copied to Checkout Sessions created by this payment link.

payment_method_types array of strings

The list of payment method types that customers can use. Defaults to your payment method settings when omitted.

Possible enum values
cryptoUSDC wallet payments on Solana.

More attributes

Returns

Returns the payment link.

POST/v1/payment_links
import { Zoneless } from '@zoneless/node';
const zoneless = new Zoneless('sk_live_z_YOUR_API_KEY', 'https://api.zoneless.com');

const paymentLink = await zoneless.paymentLinks.create({
  line_items: [
    {
      price: 'price_z_4HsWnJc8mKpQ2vRx',
      quantity: 1,
    },
  ],
});
RESPONSE
{
  "id": "plink_z_7nQ2wKpR9xVmHc4bYtLsJ8fA",
  "object": "payment_link",
  "active": true,
  "created": 1725123600,
  "after_completion": {
    "hosted_confirmation": {
      "custom_message": null
    },
    "redirect": null,
    "type": "hosted_confirmation"
  },
  "allow_promotion_codes": false,
  "application": null,
  "application_fee_amount": null,
  "application_fee_percent": null,
  "automatic_tax": {
    "enabled": false,
    "liability": null
  },
  "billing_address_collection": "auto",
  "consent_collection": null,
  "currency": "usdc",
  "custom_fields": [],
  "custom_text": {
    "after_submit": null,
    "shipping_address": null,
    "submit": null,
    "terms_of_service_acceptance": null
  },
  "customer_creation": "if_required",
  "inactive_message": null,
  "invoice_creation": {
    "enabled": false,
    "invoice_data": {
      "account_tax_ids": null,
      "custom_fields": null,
      "description": null,
      "footer": null,
      "issuer": null,
      "metadata": {},
      "rendering_options": null
    }
  },
  "livemode": false,
  "managed_payments": null,
  "metadata": {},
  "name_collection": null,
  "on_behalf_of": null,
  "optional_items": null,
  "payment_intent_data": null,
  "payment_method_collection": "always",
  "payment_method_options": null,
  "payment_method_types": [
    "crypto"
  ],
  "phone_number_collection": {
    "enabled": false
  },
  "restrictions": null,
  "shipping_address_collection": null,
  "shipping_options": [],
  "submit_type": "auto",
  "subscription_data": null,
  "tax_id_collection": {
    "enabled": false
  },
  "transfer_data": null,
  "url": "https://pay.yourdomain.com/b/n4k8m2p7q1",
  "url_slug": "n4k8m2p7q1",
  "platform_account": "acct_z_Platform123abc"
}

Update a payment link

Updates a payment link.

ENDPOINTS
POST /v1/payment_links/:id

Parameters

active boolean

Whether the payment link's url is active. If false, customers visiting the URL see a page saying that the link has been deactivated.

after_completion object

Behavior after the purchase is complete.

allow_promotion_codes boolean

Enables user redeemable promotion codes.

line_items array of objects

The line items representing what is being sold. To update an existing line item, specify its id along with the fields to change. New line items cannot be added via update. Up to 20 line items are supported.

metadata object

Set of key-value pairs that you can attach to an object. Metadata associated with this Payment Link is automatically copied to Checkout Sessions created by this payment link.

More attributes

Returns

Returns the updated payment link.

POST/v1/payment_links/:id
import { Zoneless } from '@zoneless/node';
const zoneless = new Zoneless('sk_live_z_YOUR_API_KEY', 'https://api.zoneless.com');

const paymentLink = await zoneless.paymentLinks.update(
  'plink_z_7nQ2wKpR9xVmHc4bYtLsJ8fA',
  {
    metadata: {
      order_id: '8492',
    },
  }
);
RESPONSE
{
  "id": "plink_z_7nQ2wKpR9xVmHc4bYtLsJ8fA",
  "object": "payment_link",
  "active": true,
  "created": 1725123600,
  "after_completion": {
    "hosted_confirmation": {
      "custom_message": null
    },
    "redirect": null,
    "type": "hosted_confirmation"
  },
  "allow_promotion_codes": false,
  "application": null,
  "application_fee_amount": null,
  "application_fee_percent": null,
  "automatic_tax": {
    "enabled": false,
    "liability": null
  },
  "billing_address_collection": "auto",
  "consent_collection": null,
  "currency": "usdc",
  "custom_fields": [],
  "custom_text": {
    "after_submit": null,
    "shipping_address": null,
    "submit": null,
    "terms_of_service_acceptance": null
  },
  "customer_creation": "if_required",
  "inactive_message": null,
  "invoice_creation": {
    "enabled": false,
    "invoice_data": {
      "account_tax_ids": null,
      "custom_fields": null,
      "description": null,
      "footer": null,
      "issuer": null,
      "metadata": {},
      "rendering_options": null
    }
  },
  "livemode": false,
  "managed_payments": null,
  "metadata": {
    "order_id": "8492"
  },
  "name_collection": null,
  "on_behalf_of": null,
  "optional_items": null,
  "payment_intent_data": null,
  "payment_method_collection": "always",
  "payment_method_options": null,
  "payment_method_types": [
    "crypto"
  ],
  "phone_number_collection": {
    "enabled": false
  },
  "restrictions": null,
  "shipping_address_collection": null,
  "shipping_options": [],
  "submit_type": "auto",
  "subscription_data": null,
  "tax_id_collection": {
    "enabled": false
  },
  "transfer_data": null,
  "url": "https://pay.yourdomain.com/b/n4k8m2p7q1",
  "url_slug": "n4k8m2p7q1",
  "platform_account": "acct_z_Platform123abc"
}

Retrieve a payment link

Retrieve a payment link.

ENDPOINTS
GET /v1/payment_links/:id

Parameters

No parameters.

Returns

Returns the payment link.

GET/v1/payment_links/:id
import { Zoneless } from '@zoneless/node';
const zoneless = new Zoneless('sk_live_z_YOUR_API_KEY', 'https://api.zoneless.com');

const paymentLink = await zoneless.paymentLinks.retrieve(
  'plink_z_7nQ2wKpR9xVmHc4bYtLsJ8fA'
);
RESPONSE
{
  "id": "plink_z_7nQ2wKpR9xVmHc4bYtLsJ8fA",
  "object": "payment_link",
  "active": true,
  "created": 1725123600,
  "after_completion": {
    "hosted_confirmation": {
      "custom_message": null
    },
    "redirect": null,
    "type": "hosted_confirmation"
  },
  "allow_promotion_codes": false,
  "application": null,
  "application_fee_amount": null,
  "application_fee_percent": null,
  "automatic_tax": {
    "enabled": false,
    "liability": null
  },
  "billing_address_collection": "auto",
  "consent_collection": null,
  "currency": "usdc",
  "custom_fields": [],
  "custom_text": {
    "after_submit": null,
    "shipping_address": null,
    "submit": null,
    "terms_of_service_acceptance": null
  },
  "customer_creation": "if_required",
  "inactive_message": null,
  "invoice_creation": {
    "enabled": false,
    "invoice_data": {
      "account_tax_ids": null,
      "custom_fields": null,
      "description": null,
      "footer": null,
      "issuer": null,
      "metadata": {},
      "rendering_options": null
    }
  },
  "livemode": false,
  "managed_payments": null,
  "metadata": {},
  "name_collection": null,
  "on_behalf_of": null,
  "optional_items": null,
  "payment_intent_data": null,
  "payment_method_collection": "always",
  "payment_method_options": null,
  "payment_method_types": [
    "crypto"
  ],
  "phone_number_collection": {
    "enabled": false
  },
  "restrictions": null,
  "shipping_address_collection": null,
  "shipping_options": [],
  "submit_type": "auto",
  "subscription_data": null,
  "tax_id_collection": {
    "enabled": false
  },
  "transfer_data": null,
  "url": "https://pay.yourdomain.com/b/n4k8m2p7q1",
  "url_slug": "n4k8m2p7q1",
  "platform_account": "acct_z_Platform123abc"
}

Retrieve a payment link's line items

When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.

ENDPOINTS
GET /v1/payment_links/:id/line_items

Parameters

ending_before string

A cursor for use in pagination. ending_before is an object ID that defines your place in the list.

limit integer

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.

starting_after string

A cursor for use in pagination. starting_after is an object ID that defines your place in the list.

Returns

A dictionary with a data property that contains an array of up to limit payment link line items, starting after line item starting_after. Each entry in the array is a separate line item object. If no more line items are available, the resulting array is empty.

GET/v1/payment_links/:id/line_items
import { Zoneless } from '@zoneless/node';
const zoneless = new Zoneless('sk_live_z_YOUR_API_KEY', 'https://api.zoneless.com');

const lineItems = await zoneless.paymentLinks.listLineItems(
  'plink_z_7nQ2wKpR9xVmHc4bYtLsJ8fA'
);
RESPONSE
{
  "object": "list",
  "data": [
    {
      "id": "li_z_8mKpQ2vRxWnJc4bYt",
      "object": "item",
      "amount_discount": 0,
      "amount_subtotal": 2500,
      "amount_tax": 0,
      "amount_total": 2500,
      "currency": "usdc",
      "description": "Studio Hoodie",
      "price": {
        "id": "price_z_4HsWnJc8mKpQ2vRx",
        "object": "price",
        "active": true,
        "billing_scheme": "per_unit",
        "created": 1725037200,
        "currency": "usdc",
        "custom_unit_amount": null,
        "livemode": false,
        "lookup_key": null,
        "metadata": {},
        "nickname": null,
        "product": "prod_z_2vRxWnJc8mKpQ4Hs",
        "recurring": null,
        "tax_behavior": "unspecified",
        "tiers_mode": null,
        "transform_quantity": null,
        "type": "one_time",
        "unit_amount": 2500,
        "unit_amount_decimal": "2500"
      },
      "quantity": 1
    }
  ],
  "has_more": false,
  "url": "/v1/payment_links/plink_z_7nQ2wKpR9xVmHc4bYtLsJ8fA/line_items"
}

List all payment links

Returns a list of your payment links.

ENDPOINTS
GET /v1/payment_links

Parameters

active boolean

Only return payment links that are active or inactive (for example, pass false to list all inactive payment links).

ending_before string

A cursor for use in pagination. ending_before is an object ID that defines your place in the list.

limit integer

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.

starting_after string

A cursor for use in pagination. starting_after is an object ID that defines your place in the list.

Returns

A dictionary with a data property that contains an array of up to limit payment links, starting after payment link starting_after. Each entry in the array is a separate payment link object. If no more payment links are available, the resulting array is empty.

GET/v1/payment_links
import { Zoneless } from '@zoneless/node';
const zoneless = new Zoneless('sk_live_z_YOUR_API_KEY', 'https://api.zoneless.com');

const paymentLinks = await zoneless.paymentLinks.list({
  limit: 3,
});
RESPONSE
{
  "object": "list",
  "url": "/v1/payment_links",
  "has_more": false,
  "data": [
    {
      "id": "plink_z_7nQ2wKpR9xVmHc4bYtLsJ8fA",
      "object": "payment_link",
      "active": true,
      "created": 1725123600,
      "after_completion": {
        "hosted_confirmation": {
          "custom_message": null
        },
        "redirect": null,
        "type": "hosted_confirmation"
      },
      "allow_promotion_codes": false,
      "application": null,
      "application_fee_amount": null,
      "application_fee_percent": null,
      "automatic_tax": {
        "enabled": false,
        "liability": null
      },
      "billing_address_collection": "auto",
      "consent_collection": null,
      "currency": "usdc",
      "custom_fields": [],
      "custom_text": {
        "after_submit": null,
        "shipping_address": null,
        "submit": null,
        "terms_of_service_acceptance": null
      },
      "customer_creation": "if_required",
      "inactive_message": null,
      "invoice_creation": {
        "enabled": false,
        "invoice_data": {
          "account_tax_ids": null,
          "custom_fields": null,
          "description": null,
          "footer": null,
          "issuer": null,
          "metadata": {},
          "rendering_options": null
        }
      },
      "livemode": false,
      "managed_payments": null,
      "metadata": {},
      "name_collection": null,
      "on_behalf_of": null,
      "optional_items": null,
      "payment_intent_data": null,
      "payment_method_collection": "always",
      "payment_method_options": null,
      "payment_method_types": [
        "crypto"
      ],
      "phone_number_collection": {
        "enabled": false
      },
      "restrictions": null,
      "shipping_address_collection": null,
      "shipping_options": [],
      "submit_type": "auto",
      "subscription_data": null,
      "tax_id_collection": {
        "enabled": false
      },
      "transfer_data": null,
      "url": "https://pay.yourdomain.com/b/n4k8m2p7q1",
      "url_slug": "n4k8m2p7q1",
      "platform_account": "acct_z_Platform123abc"
    }
  ]
}