checkoutAddPaymentMethod Mutation
Description
Adds a payment method to the checkout.
mutation checkoutAddPaymentMethod(
$checkoutRef: ID!
$paymentMethod: CheckoutPaymentInput!
$version: Int!
) {
checkoutAddPaymentMethod(
checkoutRef: $checkoutRef
paymentMethod: $paymentMethod
version: $version
) {
_id
id
version
origin
created
shipping {
status
fulfilled
date
method
freeShippingThreshold
tracking
shopCollection
weight
packingSlip
}
billing {
status
fulfilled
paymentDate
refundDate
}
orderId
note {
date
content
}
totals {
subtotal
subtotalBeforeTaxes
tax
grand
leftToPay
itemQuantity
discount
shipping
creditNote
balance
}
items {
_id
quantity
unavailable
added
}
buyer {
_id
firstName
lastName
email
name
path
telephone
organisation
taxNumber
}
seller {
type
name
email
ref
}
updated
expires
status
urls {
checkout
storefront
}
useSingleAddress
taxProfile {
isNationalShipping
}
locationRef
}
}
Variables
{
"checkoutRef": "d95ee105c6d14632b791e416",
"paymentMethod": {
"origin": "origin",
"amount": 29.99,
"charge": {},
"intentId": "intentId"
},
"version": 42
}
Response
{
"checkoutAddPaymentMethod": {
"_id": "03f721bc96943fe6b8542a3f",
"id": "IsC-3rGW6",
"version": 42,
"origin": "example",
"created": 1760813485687,
"shipping": {
"status": "Pending",
"fulfilled": true,
"date": 1779090092868,
"method": "example",
"freeShippingThreshold": 1.23,
"tracking": "example",
"shopCollection": true,
"weight": 1.23,
"packingSlip": "example"
},
"billing": {
"status": "example",
"fulfilled": true,
"paymentDate": 1744305332862,
"refundDate": 1772042526628
},
"orderId": "example",
"note": {
"date": 1775220310034,
"content": "example"
},
"totals": {
"subtotal": 1.23,
"subtotalBeforeTaxes": 1.23,
"tax": 1.23,
"grand": 1.23,
"leftToPay": 1.23,
"itemQuantity": 1.23,
"discount": 0.1,
"shipping": 1.23,
"creditNote": 1.23,
"balance": 1.23
},
"items": [
{
"_id": "0ba622a2df309b87966500b0",
"quantity": 1,
"unavailable": true,
"added": 1784151515048
}
],
"buyer": {
"_id": "47217f200b4816b9e6f6c4c9",
"firstName": "example",
"lastName": "example",
"email": "email@example.com",
"name": "example",
"path": "/release/1763553751/release-artist-release-name",
"telephone": "example",
"organisation": "example",
"taxNumber": "example"
},
"seller": {
"type": "example",
"name": "example",
"email": "email@example.com",
"ref": "cda6848ac2379cb7995cbc14"
},
"updated": 1784545943899,
"expires": 1755716738128,
"status": "open",
"urls": {
"checkout": "example",
"storefront": "example"
},
"useSingleAddress": true,
"taxProfile": {
"isNationalShipping": true
},
"locationRef": "6198103adfbc9db2408f2133"
}
}
Arguments
| Name | Type | Description |
|---|---|---|
checkoutRef | ID! | Reference ID of the checkout to update. |
paymentMethod | CheckoutPaymentInput! | Payment method to add including origin, amount, and optional charge data. |
version | Int! | Current version number of the checkout for optimistic locking. Prevents conflicts when multiple users edit simultaneously. |