Skip to main content

Placing an order with the GraphQL API

Using the orderCreate mutation

This is the flow to follow if you already have Spiff transactions or bundles.

You can create and update transactions and bundles using the Core SDK or the GraphQL API.

  1. Get an application key from the hub.

  2. For each item to be ordered, get the amount to order and either the Spiff transaction ID or Spiff bundle ID.

  3. Construct a request body in the form expected by the orderCreate mutation.

  4. Set the URL, HTTP method and headers of your request as described in our GraphQL basics page.

  5. Submit the request.

Using the orderCreateSimpleAsync mutation

This is a flow that you may follow if you do not already have Spiff transactions or bundles.

However, this mutation does not provide full control over the creation of orders in SpiffCommerce. To have maximum control over the creation of orders in SpiffCommerce, use the orderCreate mutation as described above.

  1. Get an application key from the hub.

  2. For each item to be ordered, construct an OrderSimpleBundleInput or OrderSimpleItemInput.

  3. Construct a request body in the form expected by the orderCreateSimpleAsync mutation.

  4. Set the URL, HTTP method and headers of your request as described in our GraphQL basics page.

  5. Submit the request.