Checkout API web_url redirect

Solved
Shopify Partner
9 1 0

Good day. Need some help with Checkout API.

 

I'll make simple checkout by:

POST admin/checkouts.json

{
"checkout": {
    "line_items": [
      {
        "variant_id": 10836612120691,
        "quantity": 5
      }
    ]
  }
}

 

And get Response with `web_url` field that is something like

"web_url": "https://test.myshopify.com/6778552435/checkouts/3a2e3e2049870aec0d7f09c2ca3ffb93",

So, i expected that this web_url will allow me to finish checkout (payment) via web interface as usual checkout, instead i got redirect to `https://test.myshopify.com/cart`.

 

What i'm doing wrong? :(

0 Likes
Highlighted
Shopify Staff
Shopify Staff
618 46 87

Hi @Rafik,

 

It looks like this app is not a sales channel. I'm not exactly sure how you managed to use the Checkout API with this app, but you'll need to ensure you've enabled the Sales Channel SDK for this app. You would enable this SDK from the App Setup section of the app page in your partner dashboard. Give that a show and let me know if you encounter other issues.

 

Cheers,

0 Likes
Highlighted
Shopify Partner
9 1 0

My app is Sallle Channel, 100% (in SC section of Shopify Admin and Sales Channel option enabled in Partner Dashboard).

Here is full response for creation an checkout:

 

{
    "checkout": {
        "clone_url": "https://test.myshopify.com/6778552435/checkouts/3fc67385517734dedf956272a8179995/clone",
        "completed_at": null,
        "created_at": "2019-03-27T03:03:17-04:00",
        "currency": "GBP",
        "presentment_currency": "GBP",
        "customer_id": null,
        "customer_locale": "en",
        "device_id": null,
        "discount_code": null,
        "email": null,
        "legal_notice_url": null,
        "location_id": null,
        "name": "#5700494360691",
        "note": "",
        "note_attributes": {},
        "order_id": null,
        "order_status_url": null,
        "order": null,
        "payment_due": "0.00",
        "payment_url": "https://elb.deposit.shopifycs.com/sessions",
        "payments": [],
        "phone": null,
        "shopify_payments_account_id": null,
        "privacy_policy_url": null,
        "refund_policy_url": null,
        "requires_shipping": false,
        "reservation_time_left": 0,
        "reservation_time": null,
        "source_identifier": null,
        "source_name": "2448289",
        "source_url": null,
        "subtotal_price": "0.00",
        "shipping_policy_url": null,
        "tax_exempt": false,
        "taxes_included": true,
        "terms_of_sale_url": null,
        "terms_of_service_url": null,
        "token": "3fc67385517734dedf956272a8179995",
        "total_price": "0.00",
        "total_tax": "0.00",
        "total_tip_received": "0.00",
        "total_line_items_price": "0.00",
        "updated_at": "2019-03-27T03:03:17-04:00",
        "user_id": null,
        "web_url": "https://test.myshopify.com/6778552435/checkouts/3fc67385517734dedf956272a8179995",
        "line_items": [],
        "gift_cards": [],
        "tax_lines": [],
        "tax_manipulations": [],
        "shipping_line": null,
        "shipping_rate": null,
        "shipping_address": null,
        "credit_card": null,
        "billing_address": null,
        "applied_discount": null
    }
}

So, as you can see total Price is 0, but product price is £529.00.

variant_id for Checkout request is taken from /cart.js output

0 Likes
Highlighted

Success.

Shopify Partner
9 1 0

So... The problem was with my Request type (text instead json), so BODY doesn't send at all :)
API doesn't show any error, it creates some weird empty checkout.

 

Now all fine (request with body)

0 Likes