Skip to content

Latest commit

 

History

History
53 lines (43 loc) · 1.26 KB

checkout-place-order.md

File metadata and controls

53 lines (43 loc) · 1.26 KB
layout group title subtitle level3_subgroup return_to menu_order functional_areas contributor_name contributor_link
tutorial
graphql
Step 10. Place the order
GraphQL checkout tutorial
graphql-checkout
title url
GraphQL Overview
graphql/index.html
100
Integration
Atwix

The placeOrder mutation places an order.

{ CART_ID } is the unique shopping cart ID from [Step 2. Create empty cart]({{ page.baseurl }}/graphql/tutorials/checkout/checkout-add-product-to-cart.html).

Send the customer's authorization token in the Authorization parameter of the header. See Authorization tokens for more information.

Request:

mutation {
  placeOrder(input: {cart_id: "{ CART_ID }"}) {
    order {
      order_number
    }
  }
}

Response:

{
  "data": {
    "placeOrder": {
      "order": {
        "order_number": "000000001"
      }
    }
  }
}

Verify this step {#verify-step}

  1. Sign in as a customer to the website using the email john.doe@example.com and password b1b2b3l@w+.

  2. Go to My Account > My Orders. The order you created is displayed. The order is also displayed on the Orders grid (Sales > Orders) in the Admin.