Skip to content

Set Payment Method

Prerequisites

The example uses an illustrative cart id. Admin cart endpoints only operate on draft carts (is_active=0) — storefront carts are rejected by the admin cart guard. Create a draft cart first with the createAdminDraftCart mutation and use the returned cartId.

Operation

OperationTypePurpose
setPaymentMethodAdminCart(input)MutationSave the chosen payment method on the draft cart

Errors

CauseNotes
409 — shipping missingSelect a shipping method first
400 — method missingInput must include method
403 — active storefront cartOnly draft carts can be modified
UnauthenticatedMissing admin Bearer token

Released under the MIT License.