Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
Hello,
I am developing a mobile application (which is registered as a private app for my client's store) that uses the Storefront API. I have implemented most of the features that the client needs, however, I have some issues while using the checkoutCompleteWithTokenizedPaymentV3 mutation with the client's Stripe account.
For the moment, I use the following queries/mutations to build my checkout and associate customer information:
# "..." Denotes the items & qty selected by the user
mutation { checkoutCreate(input:{lineItems:[...]}) { checkout { id } } }
# Query
mutation checkoutCustomerAssociateV2($checkoutId: ID!, $customerAccessToken: String!) {
checkoutCustomerAssociateV2(checkoutId: $checkoutId, customerAccessToken: $customerAccessToken) {
checkout {
id
}
}
}
# Variables JSON
{
"checkoutId": $ID,
"customerAccessToken": $CustomerAccessToken
}
# Query
mutation checkoutShippingAddressUpdateV2($shippingAddress: MailingAddressInput!, $checkoutId: ID!) {
checkoutShippingAddressUpdateV2(shippingAddress: $shippingAddress, checkoutId: $checkoutId) {
checkout {
id
}
}
}
# Variables JSON
{
"checkoutId": $ID,
"shippingAddress": {
# Shipping address information from user
}
}
query {
node(id: $ID) {
... on Checkout {
id
availableShippingRates {
ready
shippingRates {
handle
priceV2 {
amount
}
title
}
}
}
}
}
mutation checkoutShippingLineUpdate($checkoutId: ID!, $shippingRateHandle: String!) {
checkoutShippingLineUpdate(checkoutId: $checkoutId, shippingRateHandle: $shippingRateHandle) {
checkout {
id
totalTaxV2 {
amount
}
subtotalPriceV2 {
amount
}
totalPriceV2 {
amount
currencyCode
}
shippingLine {
handle
priceV2 {
amount
}
}
}
}
}
# Query
mutation checkoutCompleteWithTokenizedPaymentV3($checkoutId: ID!, $payment: TokenizedPaymentInputV3!) {
checkoutCompleteWithTokenizedPaymentV3(checkoutId: $checkoutId, payment: $payment) {
checkout {
id
}
payment {
id
errorMessage
transaction {
statusV2
kind
amountV2 {
amount
}
}
}
checkoutUserErrors {
message
code
}
}
}
# Variables
{
"checkoutId": $CheckoutID,
"payment": {
"billingAddress": {
# Billing address information
},
"idempotencyKey":"123",
"paymentAmount":{
"amount": $TotalAmount,
"currencyCode": $StoreCurrency
},
"paymentData": $StripeToken,
"type":"SHOPIFY_PAY"
}
}
The problem is that after sending the last query, the order is not created and the checkout is listed as an "abandoned checkout" in the Shopify Admin Console, no warnings/errors are shown in the order details. The Storefront API responds with the following information:
{ "checkoutCompleteWithTokenizedPaymentV3":{ "checkout":{ "id": $CheckoutID }, "checkoutUserErrors":[ ], "payment":{ "errorMessage":null, "id": $PaymentID, "transaction":null } } }
Unfortunately, this was the last step I needed in order to finish the project. But I cannot find enough information in the documentation to find a way to fix this issue. Any help would be greatly appreciated.
Greetings!
PS: I'm sorry if I am using the wrong terminology and/or do not follow "standard" Shopify developer practices. I am an embedded developer and work mostly with C/C++, I've just started developing with Shopify because of a project that I needed to accept (thanks to COVID-19 and its economical repercussions).
@alex-spataru did you find the answer to this?
I have this exact same problem. What are we doing wrong?
Is it possible to create an order through the Storefront API or not?
Same issue...
I am too sailing in the same boat.
We have requested for a Shopify Sandbox access though.
Does anyone here knows if the said access will help resolve this issue?
Any inputs would be highly appreciated.
Cheers!
Deep
Same problem here, could anyone find out why the checkout is not generating a order?
@alex-spataru did you find the answer to this?. I'm having same issue here...
Expecting reply from authorised team also ...
My store has only development subscription, Is that the reason for issue?..
We are facing the same problem. Have you been able to resolve this?
I think that the app must be made a sales channel to complete the checkout and the order is not created.
https://shopify.dev/api/examples/checkout#requirements