For guest users
Using X-Spree-Order-Token header
Cart and Checkout endpoints paths also allow interactions without the bearer token to allow creating and managing guest checkouts. When you first create a cart via:data.token
attribute.
X-Spree-Order-Token: {token}
header.
For signed in users
For users who have an account in your store, you will need to generate oAuth tokens to authenticate requests to endpoints such as Account, Cart and Checkout.Generating OAuth token
To obtain a token, execute the following curl command:access_token
and a refresh_token
, eg.
Refreshing OAuth token
OAuth tokens obtained via the previous step are valid only for a specific time (defined inexpires_in
attribute).
After that period, you can refresh the token by executing the following curl command: