Docs

The PaymentIntent object

A PaymentIntent guides you through collecting a payment from your customer. Create one PaymentIntent per order or customer session, then reference it later to inspect the history of payment attempts for that session.

Attributes

id string

Unique identifier for the object. Zoneless PaymentIntent IDs are prefixed with pi_z_.

object string

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

amount integer

Amount intended to be collected by this PaymentIntent. A positive integer in the smallest currency unit. For USDC, this is cents (e.g., 100 = $1 USDC). Supports up to eight digits.

amount_capturable integer

Amount that can be captured from this PaymentIntent.

amount_detailsnullable object

Provides industry-specific information about the amount.

amount_received integer

Amount that this PaymentIntent has collected.

applicationnullable string Expandable This can be expanded into an object with the expand request parameter.

ID of the Connect application that created the PaymentIntent.

application_fee_amountnullable integer

The amount of the application fee (if any) that will be applied to the payment and transferred to the application owner's account. Capped at the total amount captured.

automatic_payment_methodsnullable object

Settings that automatically enable compatible payment methods for this PaymentIntent.

canceled_atnullable timestamp

Populated when status is canceled. Measured in seconds since the Unix epoch.

cancellation_reasonnullable enum

Reason for cancellation of this PaymentIntent, either user-provided or generated internally.

Possible enum values
abandoned
automatic
duplicate
expired
failed_invoice
fraudulent
requested_by_customer
void_invoice
capture_method enum

Controls when funds are captured from the customer's account.

Possible enum values
automaticFunds are captured when the customer authorizes the payment.
automatic_async(Default) Funds are captured asynchronously when the customer authorizes the payment.
manualPlace a hold when the customer authorizes the payment, and capture funds later. Not all payment methods support this.
client_secretnullable string

The client secret of this PaymentIntent. Used for client-side retrieval with a publishable key. Do not store, log, or expose it to anyone other than the customer. Use TLS on any page that includes the client secret.

confirmation_method enum

Describes whether this PaymentIntent can be confirmed automatically, or requires server-side confirmation.

Possible enum values
automatic(Default) The PaymentIntent can be confirmed with a publishable key. After next_actions are handled, no additional confirmation is required.
manualPayment attempts must use a secret key. After handling next_actions, the PaymentIntent returns to requires_confirmation.
created timestamp

Time at which the object was created. Measured in seconds since the Unix epoch.

currency string

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

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

customernullable string Expandable This can be expanded into an object with the expand request parameter.

ID of the Customer this PaymentIntent belongs to, if one exists. Payment methods attached to other Customers cannot be used with this PaymentIntent.

customer_accountnullable string

ID of the Account representing the customer that this PaymentIntent belongs to, if one exists.

descriptionnullable string

An arbitrary string attached to the object. Often useful for displaying to users.

last_payment_errornullable object

The payment error encountered in the previous confirmation attempt. Cleared if the PaymentIntent is later updated.

latest_chargenullable string Expandable This can be expanded into an object with the expand request parameter.

ID of the latest Charge created by this PaymentIntent. null until confirmation is attempted.

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.

next_actionnullable object

If present, describes the actions your customer must take to complete the payment—for example, approving a wallet transfer.

on_behalf_ofnullable string Expandable This can be expanded into an object with the expand request parameter.

The connected account that is the settlement merchant for this payment, when using Connect.

payment_methodnullable string Expandable This can be expanded into an object with the expand request parameter.

ID of the payment method used in this PaymentIntent.

payment_method_optionsnullable object

Payment-method-specific configuration for this PaymentIntent.

Difference from Stripe: Zoneless exposes only the crypto options bag for USDC wallet payments.

payment_method_types array of strings

The list of payment method types that this PaymentIntent is allowed to use. For Zoneless, this is typically crypto.

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

receipt_emailnullable string

Email address that the receipt for the resulting payment will be sent to.

setup_future_usagenullable enum

Indicates that you intend to make future payments with this PaymentIntent's payment method. If you provide a Customer, the payment method can attach after confirmation.

Possible enum values
off_sessionUse when your customer may or may not be present in your checkout flow.
on_sessionUse when you intend to reuse the payment method only while the customer is present.
shippingnullable object

Shipping information for this PaymentIntent.

statement_descriptornullable string

Text retained for API compatibility as a statement descriptor. Solana USDC transfers do not display bank statement descriptors.

statement_descriptor_suffixnullable string

Suffix retained for API compatibility with statement descriptors. Blockchain transfers do not display bank statement descriptors.

status enum

Status of this PaymentIntent.

Possible enum values
canceledThe PaymentIntent has been canceled.
processingThe PaymentIntent is currently being processed.
requires_actionThe PaymentIntent requires additional action from the customer.
requires_captureThe PaymentIntent has been confirmed and requires capture.
requires_confirmationThe PaymentIntent requires confirmation.
requires_payment_methodThe PaymentIntent requires a payment method to be attached.
succeededThe PaymentIntent has succeeded.
transfer_datanullable object

The data that automatically creates a Transfer after the payment finalizes. Used with connected accounts.

transfer_groupnullable string

A string that identifies the resulting payment as part of a group.

More attributes

THE PAYMENTINTENT OBJECT
{
  "id": "pi_z_3PqK8mLkdIwHu7ix2nR5wT9b",
  "object": "payment_intent",
  "amount": 3500,
  "amount_capturable": 0,
  "amount_details": {
    "tip": {}
  },
  "amount_received": 0,
  "application": null,
  "application_fee_amount": null,
  "automatic_payment_methods": {
    "enabled": true
  },
  "canceled_at": null,
  "cancellation_reason": null,
  "capture_method": "automatic_async",
  "client_secret": "pi_z_3PqK8mLkdIwHu7ix2nR5wT9b_secret_mK8vLpQ2nR5wT9bHxJcF",
  "confirmation_method": "automatic",
  "created": 1721486400,
  "currency": "usdc",
  "customer": null,
  "customer_account": null,
  "description": null,
  "excluded_payment_method_types": null,
  "hooks": null,
  "last_payment_error": null,
  "latest_charge": null,
  "livemode": false,
  "managed_payments": null,
  "metadata": {},
  "next_action": null,
  "on_behalf_of": null,
  "payment_details": null,
  "payment_method": null,
  "payment_method_configuration_details": null,
  "payment_method_options": {
    "crypto": {}
  },
  "payment_method_types": [
    "crypto"
  ],
  "presentment_details": null,
  "processing": null,
  "receipt_email": null,
  "review": null,
  "setup_future_usage": null,
  "shared_payment_granted_token": null,
  "shipping": null,
  "statement_descriptor": null,
  "statement_descriptor_suffix": null,
  "status": "requires_payment_method",
  "transfer_data": null,
  "transfer_group": null,
  "platform_account": "acct_z_Platform123abc"
}

Create a PaymentIntent

Creates a PaymentIntent object. After creation, attach a payment method and confirm the PaymentIntent to continue the payment. When you later confirm successfully, Zoneless creates the Charge that records the USDC settlement.

ENDPOINTS
POST /v1/payment_intents

Parameters

amount integer Required

Amount intended to be collected by this PaymentIntent. A positive integer in the smallest currency unit. For USDC, this is cents (e.g., 100 = $1 USDC). Supports up to eight digits.

currency string

Three-letter currency code, in lowercase. Defaults to usdc.

Difference from Stripe: Zoneless currently accepts only usdc.

automatic_payment_methods object

When enabled, this PaymentIntent accepts payment methods that are compatible with its other parameters.

confirm boolean

Set to true to attempt to confirm this PaymentIntent immediately. Defaults to false.

Difference from Stripe: Creating and confirming in a single request is not yet supported. Create the PaymentIntent, then complete payment through your checkout or wallet flow.

customer string

ID of the Customer this PaymentIntent belongs to, if one exists. Payment methods attached to other Customers cannot be used with this PaymentIntent.

description string

An arbitrary string attached to the object. Often useful for displaying to users.

metadata object

Set of key-value pairs that you can attach to an object. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata.

payment_method string

ID of the payment method to attach to this PaymentIntent. If the payment method is attached to a Customer, you must also provide that Customer's ID.

payment_method_types array of strings

The list of payment method types that this PaymentIntent can use. For Zoneless, pass crypto.

Possible enum values
cryptoUSDC wallet payments on Solana.

More attributes

Returns

Returns a PaymentIntent object.

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

const paymentIntent = await zoneless.paymentIntents.create({
  amount: 3500,
  currency: 'usdc',
  automatic_payment_methods: {
    enabled: true,
  },
});
RESPONSE
{
  "id": "pi_z_3PqK8mLkdIwHu7ix2nR5wT9b",
  "object": "payment_intent",
  "amount": 3500,
  "amount_capturable": 0,
  "amount_details": {
    "tip": {}
  },
  "amount_received": 0,
  "application": null,
  "application_fee_amount": null,
  "automatic_payment_methods": {
    "enabled": true
  },
  "canceled_at": null,
  "cancellation_reason": null,
  "capture_method": "automatic_async",
  "client_secret": "pi_z_3PqK8mLkdIwHu7ix2nR5wT9b_secret_mK8vLpQ2nR5wT9bHxJcF",
  "confirmation_method": "automatic",
  "created": 1721486400,
  "currency": "usdc",
  "customer": null,
  "customer_account": null,
  "description": null,
  "excluded_payment_method_types": null,
  "hooks": null,
  "last_payment_error": null,
  "latest_charge": null,
  "livemode": false,
  "managed_payments": null,
  "metadata": {},
  "next_action": null,
  "on_behalf_of": null,
  "payment_details": null,
  "payment_method": null,
  "payment_method_configuration_details": null,
  "payment_method_options": {
    "crypto": {}
  },
  "payment_method_types": [
    "crypto"
  ],
  "presentment_details": null,
  "processing": null,
  "receipt_email": null,
  "review": null,
  "setup_future_usage": null,
  "shared_payment_granted_token": null,
  "shipping": null,
  "statement_descriptor": null,
  "statement_descriptor_suffix": null,
  "status": "requires_payment_method",
  "transfer_data": null,
  "transfer_group": null,
  "platform_account": "acct_z_Platform123abc"
}

Update a PaymentIntent

Updates properties on a PaymentIntent object without confirming. Depending on which properties you update, you might need to confirm the PaymentIntent again—for example, updating payment_method always requires confirmation.

ENDPOINTS
POST /v1/payment_intents/:id

Parameters

amount integer

Amount intended to be collected by this PaymentIntent. A positive integer in the smallest currency unit. For USDC, this is cents.

currency string

Three-letter currency code, in lowercase. For Zoneless, use usdc.

customer string

ID of the Customer this PaymentIntent belongs to, if one exists.

description string

An arbitrary string attached to the object. Often useful for displaying to users.

metadata object

Set of key-value pairs that you can attach to an object. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata.

payment_method string

ID of the payment method to attach to this PaymentIntent. To unset this field, pass an empty string. Updating payment_method typically requires confirming the PaymentIntent again.

receipt_email string

Email address that the receipt for the resulting payment will be sent to.

shipping object

Shipping information for this PaymentIntent.

More attributes

Returns

Returns a PaymentIntent object.

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

const paymentIntent = await zoneless.paymentIntents.update(
  'pi_z_3PqK8mLkdIwHu7ix2nR5wT9b',
  {
    metadata: {
      order_id: '9142',
    },
  }
);
RESPONSE
{
  "id": "pi_z_3PqK8mLkdIwHu7ix2nR5wT9b",
  "object": "payment_intent",
  "amount": 3500,
  "amount_capturable": 0,
  "amount_details": {
    "tip": {}
  },
  "amount_received": 0,
  "application": null,
  "application_fee_amount": null,
  "automatic_payment_methods": {
    "enabled": true
  },
  "canceled_at": null,
  "cancellation_reason": null,
  "capture_method": "automatic_async",
  "client_secret": "pi_z_3PqK8mLkdIwHu7ix2nR5wT9b_secret_mK8vLpQ2nR5wT9bHxJcF",
  "confirmation_method": "automatic",
  "created": 1721486400,
  "currency": "usdc",
  "customer": null,
  "customer_account": null,
  "description": null,
  "excluded_payment_method_types": null,
  "hooks": null,
  "last_payment_error": null,
  "latest_charge": null,
  "livemode": false,
  "managed_payments": null,
  "metadata": {
    "order_id": "9142"
  },
  "next_action": null,
  "on_behalf_of": null,
  "payment_details": null,
  "payment_method": null,
  "payment_method_configuration_details": null,
  "payment_method_options": {
    "crypto": {}
  },
  "payment_method_types": [
    "crypto"
  ],
  "presentment_details": null,
  "processing": null,
  "receipt_email": null,
  "review": null,
  "setup_future_usage": null,
  "shared_payment_granted_token": null,
  "shipping": null,
  "statement_descriptor": null,
  "statement_descriptor_suffix": null,
  "status": "requires_payment_method",
  "transfer_data": null,
  "transfer_group": null,
  "platform_account": "acct_z_Platform123abc"
}

Retrieve a PaymentIntent

Retrieves the details of a PaymentIntent that has previously been created. You can retrieve a PaymentIntent client-side using a publishable key when the client_secret is provided. With a publishable key, only a subset of properties is returned.

ENDPOINTS
GET /v1/payment_intents/:id

Parameters

client_secret string

The client secret of the PaymentIntent. Required when retrieving with a publishable key.

Returns

Returns a PaymentIntent if a valid identifier was provided.

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

const paymentIntent = await zoneless.paymentIntents.retrieve(
  'pi_z_3PqK8mLkdIwHu7ix2nR5wT9b'
);
RESPONSE
{
  "id": "pi_z_3PqK8mLkdIwHu7ix2nR5wT9b",
  "object": "payment_intent",
  "amount": 3500,
  "amount_capturable": 0,
  "amount_details": {
    "tip": {}
  },
  "amount_received": 0,
  "application": null,
  "application_fee_amount": null,
  "automatic_payment_methods": {
    "enabled": true
  },
  "canceled_at": null,
  "cancellation_reason": null,
  "capture_method": "automatic_async",
  "client_secret": "pi_z_3PqK8mLkdIwHu7ix2nR5wT9b_secret_mK8vLpQ2nR5wT9bHxJcF",
  "confirmation_method": "automatic",
  "created": 1721486400,
  "currency": "usdc",
  "customer": null,
  "customer_account": null,
  "description": null,
  "excluded_payment_method_types": null,
  "hooks": null,
  "last_payment_error": null,
  "latest_charge": null,
  "livemode": false,
  "managed_payments": null,
  "metadata": {},
  "next_action": null,
  "on_behalf_of": null,
  "payment_details": null,
  "payment_method": null,
  "payment_method_configuration_details": null,
  "payment_method_options": {
    "crypto": {}
  },
  "payment_method_types": [
    "crypto"
  ],
  "presentment_details": null,
  "processing": null,
  "receipt_email": null,
  "review": null,
  "setup_future_usage": null,
  "shared_payment_granted_token": null,
  "shipping": null,
  "statement_descriptor": null,
  "statement_descriptor_suffix": null,
  "status": "requires_payment_method",
  "transfer_data": null,
  "transfer_group": null,
  "platform_account": "acct_z_Platform123abc"
}

List all PaymentIntents

Returns a list of PaymentIntents.

ENDPOINTS
GET /v1/payment_intents

Parameters

customer string

Only return PaymentIntents for the customer specified by this customer ID.

customer_account string

Only return PaymentIntents for the account representing the customer specified by this ID.

status enum

Only return PaymentIntents with this status.

Zoneless extension: The incomplete filter expands to all open PaymentIntent statuses for dashboard-style list views.

Possible enum values
canceled
processing
requires_action
requires_capture
requires_confirmation
requires_payment_method
succeeded
incompleteConvenience filter for every non-succeeded, non-canceled status (matches the Incomplete badge in list UIs).

More attributes

Returns

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

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

const paymentIntents = await zoneless.paymentIntents.list({
  limit: 3,
});
RESPONSE
{
  "object": "list",
  "url": "/v1/payment_intents",
  "has_more": false,
  "data": [
    {
      "id": "pi_z_3PqK8mLkdIwHu7ix2nR5wT9b",
      "object": "payment_intent",
      "amount": 3500,
      "amount_capturable": 0,
      "amount_details": {
        "tip": {}
      },
      "amount_received": 0,
      "application": null,
      "application_fee_amount": null,
      "automatic_payment_methods": {
        "enabled": true
      },
      "canceled_at": null,
      "cancellation_reason": null,
      "capture_method": "automatic_async",
      "client_secret": "pi_z_3PqK8mLkdIwHu7ix2nR5wT9b_secret_mK8vLpQ2nR5wT9bHxJcF",
      "confirmation_method": "automatic",
      "created": 1721486400,
      "currency": "usdc",
      "customer": null,
      "customer_account": null,
      "description": null,
      "excluded_payment_method_types": null,
      "hooks": null,
      "last_payment_error": null,
      "latest_charge": null,
      "livemode": false,
      "managed_payments": null,
      "metadata": {},
      "next_action": null,
      "on_behalf_of": null,
      "payment_details": null,
      "payment_method": null,
      "payment_method_configuration_details": null,
      "payment_method_options": {
        "crypto": {}
      },
      "payment_method_types": [
        "crypto"
      ],
      "presentment_details": null,
      "processing": null,
      "receipt_email": null,
      "review": null,
      "setup_future_usage": null,
      "shared_payment_granted_token": null,
      "shipping": null,
      "statement_descriptor": null,
      "statement_descriptor_suffix": null,
      "status": "requires_payment_method",
      "transfer_data": null,
      "transfer_group": null,
      "platform_account": "acct_z_Platform123abc"
    }
  ]
}

List amount details line items

Lists all line items under amount_details for a given PaymentIntent.

ENDPOINTS
GET /v1/payment_intents/:id/amount_details_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 line items for the given PaymentIntent, 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_intents/:id/amount_details_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.paymentIntents.listAmountDetailsLineItems(
  'pi_z_3PqK8mLkdIwHu7ix2nR5wT9b'
);
RESPONSE
{
  "object": "list",
  "url": "/v1/payment_intents/pi_z_3PqK8mLkdIwHu7ix2nR5wT9b/amount_details_line_items",
  "has_more": false,
  "data": [
    {
      "id": "uli_z_K8mWqR2vLpQbNx",
      "object": "payment_intent_amount_details_line_item",
      "discount_amount": 75,
      "payment_method_options": null,
      "product_code": "SKU214",
      "product_name": "Ceramic Mug",
      "quantity": 1,
      "tax": {
        "total_tax_amount": 28
      },
      "unit_cost": 3500,
      "unit_of_measure": "each"
    }
  ]
}

Cancel a PaymentIntent

You can cancel a PaymentIntent when its status is requires_payment_method, requires_capture, requires_confirmation, requires_action, or (in rare cases) processing. After cancellation, no additional charges are made and operations on the PaymentIntent fail with an error. For PaymentIntents in requires_capture, the remaining amount_capturable is automatically refunded.

ENDPOINTS
POST /v1/payment_intents/:id/cancel

Parameters

cancellation_reason enum

Reason for canceling this PaymentIntent.

Possible enum values
abandoned
duplicate
fraudulent
requested_by_customer

Returns

Returns a PaymentIntent object if the cancellation succeeds. Returns an error if the PaymentIntent is already canceled or isn't in a cancelable state.

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

const paymentIntent = await zoneless.paymentIntents.cancel(
  'pi_z_3PqK8mLkdIwHu7ix2nR5wT9b',
  {
    cancellation_reason: 'requested_by_customer',
  }
);
RESPONSE
{
  "id": "pi_z_3PqK8mLkdIwHu7ix2nR5wT9b",
  "object": "payment_intent",
  "amount": 3500,
  "amount_capturable": 0,
  "amount_details": {
    "tip": {}
  },
  "amount_received": 0,
  "application": null,
  "application_fee_amount": null,
  "automatic_payment_methods": {
    "enabled": true
  },
  "canceled_at": 1721487123,
  "cancellation_reason": "requested_by_customer",
  "capture_method": "automatic_async",
  "client_secret": "pi_z_3PqK8mLkdIwHu7ix2nR5wT9b_secret_mK8vLpQ2nR5wT9bHxJcF",
  "confirmation_method": "automatic",
  "created": 1721486400,
  "currency": "usdc",
  "customer": null,
  "customer_account": null,
  "description": null,
  "excluded_payment_method_types": null,
  "hooks": null,
  "last_payment_error": null,
  "latest_charge": null,
  "livemode": false,
  "managed_payments": null,
  "metadata": {},
  "next_action": null,
  "on_behalf_of": null,
  "payment_details": null,
  "payment_method": null,
  "payment_method_configuration_details": null,
  "payment_method_options": {
    "crypto": {}
  },
  "payment_method_types": [
    "crypto"
  ],
  "presentment_details": null,
  "processing": null,
  "receipt_email": null,
  "review": null,
  "setup_future_usage": null,
  "shared_payment_granted_token": null,
  "shipping": null,
  "statement_descriptor": null,
  "statement_descriptor_suffix": null,
  "status": "canceled",
  "transfer_data": null,
  "transfer_group": null,
  "platform_account": "acct_z_Platform123abc"
}