Is it possible to turn checkout into an order?

Solved
Highlighted
Tourist
12 0 0

I'm trying to customize the payment process with Stripe. Here's what I'm trying to do: 

 

  1. Custom storefront with Shopify-Buy SDK
  2. Create a checkout
  3. Forward to the Stripe payment page
  4. When the payment is successful, create a paid order

But when I create a checkout, a variant id in the lineitem list is a long string like this

Z2lkOi8vc2hvcGlmff9Qcm9kdWN0VmFyaWFudCxxOTQ1NDI1NDaaNzQ4OQ

I'm not able to create an order with this (admin/api/2019-04/draft_orders.json). It says: 

400 - {"errors":{"variant_id":"expected String to be a id"}}

What should I do? Is there a way to automatically convert a checkout into an order? 

0 Likes

Success.

Shopify Staff
Shopify Staff
1555 79 242

Those should be Base64 strings. The unencoded form would look something like this: 

 

gid://shopify/ProductVariant/7432503197739
1 Like
Tourist
12 0 0

Wow, this was it! Thank you

I wonder why it wasn't mentioned in the documentation. 

0 Likes