Skip to content

paymentDetailsSubmit

Mutationin Payment

Continue a payment that paymentCreate answered with a PaymentSdkAction, with what the provider's component reported once the shopper acted, such as PayPal's approval. Pass the component's data as it is.

Answers what happens next as paymentCreate does: a payment that covers a cart orders it, and the order comes back on PaymentComplete, or PaymentPending while the provider confirms. A refusal releases the cart, so the shopper can pay another way.

A guest cart needs its email first, set from what the component reported, since the order is created from the cart. Without it this answers a ValidationError before anything is charged.

Arguments

ArgumentTypeDescription
targetPaymentTargetInput!The cart or order the payment was created against
paymentIdID!The payment PaymentSdkAction named
detailsJSON!What the provider's component reported, verbatim

Returns

PaymentDetailsSubmitResponse!

FieldTypeDescription
nextPaymentNextWhat the shopper does next, when the details were accepted
paymentErrors[PaymentDetailsSubmitError!]Error details if the payment could not be continued

Example

mutation PaymentDetailsSubmit(
$target: PaymentTargetInput!
$paymentId: ID!
$details: JSON!
) {
paymentDetailsSubmit(
target: $target
paymentId: $paymentId
details: $details
) {
next {
__typename
... on PaymentRedirect {
redirectUrl
}
... on PaymentComplete {
__typename
}
... on PaymentSdkAction {
provider
action
}
}
paymentErrors {
__typename
... on PaymentError {
code
message
}
... on ValidationError {
message
}
}
}
}

The query selects the return type's fields two levels deep; pick the ones you need. The response shows its shape with placeholder values.

Served by

@evolve-framework/commercetoolsResolved
@evolve-framework/medusaNot resolved
@evolve-framework/sfccNot resolved

Used by

The storefront packages that send it, in these GraphQL documents: