Skip to main content

Payments API

The Payments API provides read-only access to the available and selected payment options during checkout. Use this API to detect specific payment types, display targeted messaging, and adjust your extension based on the buyer's payment selection.

Payment options are read-only. Extensions can't add, remove, or modify available payment methods.

  • Promote express payment methods: Detect whether wallet-based payment options like Apple Pay or Google Pay are available and encourage the buyer to use them.
  • Display security messaging: Show a trust badge or security message when the buyer selects a credit card payment method.
  • Adjust UI by payment type: Render different content depending on which payment option the buyer has selected.
Support
Targets (31)

The shopify global object provides payment data for the current checkout. Access the following properties on shopify to read available and selected payment options. Available to purchase extension targets.

Anchor to availablePaymentOptions
availablePaymentOptions
<[]>
required

All payment options available to the buyer for this checkout, such as credit cards, wallets, and local payment methods. The list depends on the shop's payment configuration and the buyer's region.

The set of payment options can change when the buyer updates their address or cart, so subscribe to changes rather than reading once during initialization. Each option exposes handle and type only. Provider names, logos, fees, and installment terms aren't available.

Anchor to selectedPaymentOptions
selectedPaymentOptions
<[]>
required

The payment options the buyer has currently selected. This updates as the buyer changes their payment method. The array can contain multiple entries when the buyer splits payment across methods (for example, a gift card and a credit card).

Each option exposes handle and type only. Provider names, logos, fees, and installment terms aren't available.


  • Don't assume specific payment types are available: Payment options depend on the merchant's configuration and the buyer's region. Always check the list dynamically rather than hardcoding expectations.

Was this page helpful?