CartPaymentMethod
Describes a cart payment method, including its type, status, fees, and additional information.
Type Definition
type CartPaymentMethod {
type: String
title: String
status: String
isPaid: Boolean
currency: Currency
info: String
description: String
fee: Float
netFee: Float
tax: Float
paidAmount: Float
rate: Float
ratePercentage: Float
giftCard: GiftCard
}
Fields
Field | Type | Nullable | Description | Relationship |
---|---|---|---|---|
type | String | Yes | Returns the type of the payment method. | — |
title | String | Yes | Returns the title of the payment method. | — |
status | String | Yes | Returns the status of the payment method. | — |
isPaid | Boolean | Yes | Returns true if this payment method status is paid. | — |
currency | Currency | Yes | Returns the payment method currency. See Currency for details. | Related to Currency |
info | String | Yes | Returns additional information about the payment method. | — |
description | String | Yes | Returns the payment method description. | — |
fee | Float | Yes | Returns the payment fee in the customer’s currency. | — |
netFee | Float | Yes | Returns the payment fee without tax in the customer’s currency. | — |
tax | Float | Yes | Returns the tax amount in the customer’s currency. | — |
paidAmount | Float | Yes | Returns the paid amount in the customer’s currency. | — |
rate | Float | Yes | Returns the tax rate in decimals (e.g., 0.20 for 20%). | — |
ratePercentage | Float | Yes | Returns the tax rate as a percentage (e.g., 20 for 20%). | — |
giftCard | GiftCard | Yes | If the payment method type is gift_card , returns a GiftCard object with information about the gift card used. | Related to GiftCard |
Relationships
- currency: Links to the
Currency
object type, representing the currency used for the payment method. This allows querying currency code, symbol, and formatting details. - giftCard: When the payment method type is
gift_card
, this field links to theGiftCard
object type, providing detailed information about the gift card used for payment.
Usage Examples
Basic Query
Fetch basic details about a cart payment method including its type, status, and payment state:
{
cartPaymentMethod {
type
title
status
isPaid
}
}
Field Selection
Retrieve detailed financial information about the payment method including fees, taxes, and paid amount:
{
cartPaymentMethod {
fee
netFee
tax
paidAmount
rate
ratePercentage
}
}
Nested Queries
Access nested related objects such as the currency details and gift card information (if applicable):
{
cartPaymentMethod {
currency {
code
symbol
name
}
giftCard {
id
balance
lastCharacters
expiryDate
}
}
}
Filtering and Sorting
While CartPaymentMethod
itself does not support direct filtering or sorting fields, it is typically part of larger queries (e.g., cart or order queries) where filtering and sorting can be applied on those parent objects.
Example: Querying multiple payment methods within a cart and sorting them by status
(assuming the parent query supports it):
{
cart(id: 12345) {
paymentMethods(sortBy: STATUS_ASC) {
type
status
isPaid
}
}
}
Implements
This type does not implement any interfaces.
Connections
CartPaymentMethod
is commonly connected to cart or order objects as part of their payment details. It references related types:
Currency
— for currency informationGiftCard
— for gift card payment details when applicable
Related Types
- Currency: Represents currency details such as code, symbol, and formatting.
- GiftCard: Represents gift card details including balance and expiry.
Best Practices
- Always check the
isPaid
field to confirm if the payment method has been successfully paid. - Use the
currency
field to format monetary values correctly in your UI. - When handling gift card payments, access the
giftCard
field to display relevant gift card information securely. - Avoid querying all fields if only a subset is needed to reduce response size and improve performance.
- Use nested queries to fetch related objects in a single request, minimizing round-trips.
Notes
- All fields in
CartPaymentMethod
are optional and may returnnull
if data is not available. - Monetary fields (
fee
,netFee
,tax
,paidAmount
) are returned in the customer’s currency as indicated by thecurrency
field. - Tax rates are provided both as decimal (
rate
) and percentage (ratePercentage
) for flexibility. - The
giftCard
field is only populated when the payment method type isgift_card
. - This API currently requires no authentication; however, this may change in future versions. Ensure your implementation can handle authentication if introduced later.
- Consider caching payment method data carefully, especially if payment status or fees may change during the checkout process. Always fetch fresh data before finalizing orders.