Re: checkout API or how to create a checkout url to my private app's items

checkout API or how to create a checkout url to my private app's items

roland_bodnar
Shopify Partner
1 0 0

Hi,

I've built up the connection beetwen my PHP page and Shopify products. That was nice and easy while read products with :

GET /admin/products.json

I would like to collect items on my side, and when the visitor decided to buy, I would like to redirect them to shopify's shop/payment page. As far as I know, here comes the checkout API.  I made a call like:

POST /api/checkouts.json

with a json array:

[
    'checkout' => [
        'email'      => 'me@example.com',
        'line_items' => [
            [
                'variant_id' => 5921300807,
                'quantity'   => 1,
            ],
        ],
    ],
]

btw the problem is, the response message:

Unauthorized: No valid credentials provided.

Is this because I'm not approved for the sales channel sdk, or something else wrong (parameters in array).

Alternative solutions also welcome, my point is to redirect the visitor to the Shopify page wher he/she can pay for the item/items.

Regards, Roland.

Replies 5 (5)

José_Huerta
New Member
4 0 0

I am also facing the same problem. Did you manage to solve? 

Jamie_D_
Shopify Staff (Retired)
533 1 92

Hi Roland,

Checkout API is only available to use with the Sales Channel SDK.

To learn more visit the Shopify Help Center or the Community Blog.

José_Huerta
New Member
4 0 0

JM10
Visitor
1 0 1

Hi Jamie,

 

I'm also facing the same issue. If the checkout API is not available for individual stores, can you point us out to other alternatives instead?

Thanks,

Eray_Tuncer1
Shopify Partner
2 0 1

@Jamie could you please provide us any alternative method? Especially for testing the checkout api.