According to the API specification, a cart represents a buyer's intent to purchase a product. The state of the cart is based on the action performed by the buyer.
Based on the API specification's Cart schema:
id
- Unique identifier- Cart state and status information
- Associated product and user information
When using the enriched option, additional details are available:
gross
- Pricing informationcoupon_code
- Applied coupon informationlicenses
- License details
GET /products/{product_id}/carts/{cart_id}.json
Retrieves detailed information about a specific cart.
product_id
(path) - The ID of the productcart_id
(path) - The ID of the cartenriched
(query) - Optional boolean parameter to get enriched cart detailsfields
(query) - Optional parameter to specify which fields to return
GET /products/{product_id}/carts.json
Retrieves a list of carts associated with a product.
DELETE /products/{product_id}/carts/{cart_id}.json
Deletes a specific cart.
Carts can be in different states based on buyer actions:
- Initial creation
- Checkout process
- Completion or abandonment
The API provides an enriched option to get additional cart details:
- Use
enriched=true
query parameter - Returns additional fields like gross, coupon_code, and licenses
Cart-related endpoints may return the following error responses:
400
- Bad Request401
- Unauthorized402
- Payment Required404
- Cart Not Found
# Basic cart details
curl -X GET "https://api.freemius.com/v1/products/{product_id}/carts/{cart_id}.json" \
-H "Authorization: Bearer YOUR_API_KEY"
# Enriched cart details
curl -X GET "https://api.freemius.com/v1/products/{product_id}/carts/{cart_id}.json?enriched=true" \
-H "Authorization: Bearer YOUR_API_KEY"
curl -X GET "https://api.freemius.com/v1/products/{product_id}/carts.json" \
-H "Authorization: Bearer YOUR_API_KEY"
curl -X DELETE "https://api.freemius.com/v1/products/{product_id}/carts/{cart_id}.json" \
-H "Authorization: Bearer YOUR_API_KEY"
After understanding carts, you can:
- Learn about Coupons
- Explore Trials
- Understand Advanced Topics