Checkout APIs
Checkout GraphQL APIs can be executed by sending an HTTP POST request to the following URL:
https://<marketplace-url>/api/graphql
Send requests using the URL with a query/mutation and variables, or a GraphQL client library.
Method: POST
URL:
https://marketplace-url/api/graphql
If the API is in preview phase, then use:
https://marketplace-url/api/graphql/preview
Headers:
Authorization: Bearer <access_token>
Content-Type: application/json
Here's an example of a request payload in json:
{
"query": "mutation addItemsToCart($input: AddItemsInput!) {\n addItemsToCart(input: $input) {\n cart {\n id\n items {\n id\n product {\n name\n }\n }\n pricingTotal {\n amountDueAfterTax\n totalTaxAmount\n }\n }\n }\n}\n",
"variables": {
"input": {
"items": [
{
"pricingPlanId": "ae1acd7c-e161-4dc1-8b35-1865138874ce"
}
],
"userId": "95cce1ea-37fb-431d-9f5a-7df387b7e8e4",
"accountId": "9faf88c2-9e58-4f5b-a009-5dc9094fe2a0"
}
}
}
List of APIs
Use the various GraphQL and REST APIs described in this section of the guide to extend the capabilities of Checkout to build and manage customized workflows.
- Fetch the details of an active cart
- Add items to a cart
- Remove items from a cart
- Apply/remove discount codes
- Get the cart fields
- Update cart details
- Add/edit payment details
- Fetch, add, and modify shipping details for a cart
- Validate cart details
- Finalize a cart
- Fetch checkout settings
- Fetch product recommendations
- Add product recommendations to a cart
Was this page helpful?
Tell us more…
Help us improve our content. Responses are anonymous.
Thanks
We appreciate your feedback!