{"openapi":"3.1.0","info":{"title":"marve-py-cart-service","version":"0.1.0"},"paths":{"/carts/health":{"get":{"tags":["Carts"],"summary":"Health check","operationId":"health_carts_health_get","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"properties":{"message":{"type":"string"}},"additionalProperties":true,"type":"object","required":["message"],"example":{"message":"marve-py-cart-service is okay and running, fast!"}},"example":{"message":"marve-py-cart-service is okay and running, fast!"}}}},"500":{"description":"Unexpected failure. Quote `error_reference` when reporting it","content":{"application/json":{"schema":{"properties":{"error_reference":{"type":"string"},"error_type":{"type":"string"},"errors":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object"},"status_code":{"type":"integer"},"timestamp":{"type":"string"}},"additionalProperties":true,"type":"object","required":["error_reference","error_type","errors","status_code","timestamp"],"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}},"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}}}}}}},"/carts/product/{product_reference}":{"get":{"tags":["Carts"],"summary":"The basket line holding a product","description":"Looks in the signed-in user's basket for the line holding `product_reference`. 404 when that product is not in the basket.","operationId":"get_cart_product_by_product_reference_carts_product__product_reference__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"product_reference","in":"path","required":true,"schema":{"type":"string","title":"Product Reference"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"reference":{"type":"string"},"user_reference":{"type":["string","null"]},"product":{"type":["object","null"],"additionalProperties":true},"bundle":{"type":["object","null"],"additionalProperties":true},"license":{"type":["object","null"],"additionalProperties":true},"discount":{"type":["object","null"],"additionalProperties":true},"price":{"type":"number"},"metadata":{"type":"object","additionalProperties":true},"created_by_reference":{"type":["string","null"]},"created_at_timestamp":{"type":["string","null"]},"updated_by_reference":{"type":["string","null"]},"updated_at_timestamp":{"type":["string","null"]}},"additionalProperties":true,"required":["reference","price"],"example":{"reference":"33333333-3333-3333-3333-333333333333","user_reference":"11111111-1111-1111-1111-111111111111","product":{"reference":"22222222-2222-2222-2222-222222222222","product_name":"Ports"},"bundle":{"bundle_name":"Custom Bundle"},"license":{"data":[{"feature_reference":"feature-1","feature_name":"Bathymetry","feature_price":150.0}],"valid_to":"2026-06-01T00:00:00","duration":6},"discount":{},"price":150.0,"metadata":{},"created_by_reference":"11111111-1111-1111-1111-111111111111","created_at_timestamp":"2026-09-30T10:00:00","updated_by_reference":"11111111-1111-1111-1111-111111111111","updated_at_timestamp":"2026-09-30T10:00:00"}},"example":{"reference":"33333333-3333-3333-3333-333333333333","user_reference":"11111111-1111-1111-1111-111111111111","product":{"reference":"22222222-2222-2222-2222-222222222222","product_name":"Ports"},"bundle":{"bundle_name":"Custom Bundle"},"license":{"data":[{"feature_reference":"feature-1","feature_name":"Bathymetry","feature_price":150.0}],"valid_to":"2026-06-01T00:00:00","duration":6},"discount":{},"price":150.0,"metadata":{},"created_by_reference":"11111111-1111-1111-1111-111111111111","created_at_timestamp":"2026-09-30T10:00:00","updated_by_reference":"11111111-1111-1111-1111-111111111111","updated_at_timestamp":"2026-09-30T10:00:00"}}}},"401":{"description":"No token, an expired token, or the basket line belongs to somebody else","content":{"application/json":{"schema":{"type":"object","properties":{"error_reference":{"type":"string"},"error_type":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"status_code":{"type":"integer"},"timestamp":{"type":"string"}},"additionalProperties":true,"required":["error_reference","error_type","errors","status_code","timestamp"],"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}},"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}}}},"404":{"description":"Nothing found: no such line, an empty basket, or an unknown promo code","content":{"application/json":{"schema":{"type":"object","properties":{"error_reference":{"type":"string"},"error_type":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"status_code":{"type":"integer"},"timestamp":{"type":"string"}},"additionalProperties":true,"required":["error_reference","error_type","errors","status_code","timestamp"],"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}},"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}}}},"500":{"description":"Unexpected failure. Quote `error_reference` when reporting it","content":{"application/json":{"schema":{"type":"object","properties":{"error_reference":{"type":"string"},"error_type":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"status_code":{"type":"integer"},"timestamp":{"type":"string"}},"additionalProperties":true,"required":["error_reference","error_type","errors","status_code","timestamp"],"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}},"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/carts/empty":{"delete":{"tags":["Carts"],"summary":"Empty the basket","description":"Removes every line and the basket itself. 404 when the basket is already empty.\n\nA super admin may act on somebody else's basket by passing `target_user_reference`; for anybody else it is ignored. It may come in the body or the query.","operationId":"empty_cart_products_carts_empty_delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"target_user_reference","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Super admin only: whose basket to act on.","title":"Target User Reference"},"description":"Super admin only: whose basket to act on."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"reference":{"type":["string","null"]},"message":{"type":"string"}},"additionalProperties":true,"required":["message"],"example":{"reference":"11111111-1111-1111-1111-111111111111","message":"Cart checkout initiated for user 11111111-1111-1111-1111-111111111111"}},"example":{"reference":"11111111-1111-1111-1111-111111111111","message":"Cart checkout initiated for user 11111111-1111-1111-1111-111111111111"}}}},"401":{"description":"No token, an expired token, or the basket line belongs to somebody else","content":{"application/json":{"schema":{"type":"object","properties":{"error_reference":{"type":"string"},"error_type":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"status_code":{"type":"integer"},"timestamp":{"type":"string"}},"additionalProperties":true,"required":["error_reference","error_type","errors","status_code","timestamp"],"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}},"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}}}},"404":{"description":"Nothing found: no such line, an empty basket, or an unknown promo code","content":{"application/json":{"schema":{"type":"object","properties":{"error_reference":{"type":"string"},"error_type":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"status_code":{"type":"integer"},"timestamp":{"type":"string"}},"additionalProperties":true,"required":["error_reference","error_type","errors","status_code","timestamp"],"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}},"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}}}},"500":{"description":"Unexpected failure. Quote `error_reference` when reporting it","content":{"application/json":{"schema":{"type":"object","properties":{"error_reference":{"type":"string"},"error_type":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"status_code":{"type":"integer"},"timestamp":{"type":"string"}},"additionalProperties":true,"required":["error_reference","error_type","errors","status_code","timestamp"],"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}},"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"target_user_reference":{"type":"string"}},"additionalProperties":true},"example":{"target_user_reference":"11111111-1111-1111-1111-111111111111"}}}}}},"/carts/discount":{"delete":{"tags":["Carts"],"summary":"Remove the promo code","description":"Clears the basket's discount. A super admin may act on somebody else's basket by passing `target_user_reference`; for anybody else it is ignored. It may come in the body or the query.","operationId":"remove_discount_to_cart_carts_discount_delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"target_user_reference","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Super admin only: whose basket to act on.","title":"Target User Reference"},"description":"Super admin only: whose basket to act on."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"reference":{"type":["string","null"]},"message":{"type":"string"}},"additionalProperties":true,"required":["message"],"example":{"reference":"11111111-1111-1111-1111-111111111111","message":"Cart checkout initiated for user 11111111-1111-1111-1111-111111111111"}},"example":{"reference":"11111111-1111-1111-1111-111111111111","message":"Cart checkout initiated for user 11111111-1111-1111-1111-111111111111"}}}},"401":{"description":"No token, an expired token, or the basket line belongs to somebody else","content":{"application/json":{"schema":{"type":"object","properties":{"error_reference":{"type":"string"},"error_type":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"status_code":{"type":"integer"},"timestamp":{"type":"string"}},"additionalProperties":true,"required":["error_reference","error_type","errors","status_code","timestamp"],"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}},"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}}}},"500":{"description":"Unexpected failure. Quote `error_reference` when reporting it","content":{"application/json":{"schema":{"type":"object","properties":{"error_reference":{"type":"string"},"error_type":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"status_code":{"type":"integer"},"timestamp":{"type":"string"}},"additionalProperties":true,"required":["error_reference","error_type","errors","status_code","timestamp"],"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}},"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"target_user_reference":{"type":"string"}},"additionalProperties":true},"example":{"target_user_reference":"11111111-1111-1111-1111-111111111111"}}}}},"post":{"tags":["Carts"],"summary":"Apply a promo code","description":"Checks the code is known, in date, under its usage limit and above its minimum spend, then applies it to the basket. 404 when there is no basket or no such code.\n\nA super admin may act on somebody else's basket by passing `target_user_reference`; for anybody else it is ignored. Body only.","operationId":"add_discount_to_cart_carts_discount_post","security":[{"HTTPBearer":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"reference":{"type":["string","null"]},"message":{"type":"string"}},"additionalProperties":true,"required":["message"],"example":{"reference":"11111111-1111-1111-1111-111111111111","message":"Cart checkout initiated for user 11111111-1111-1111-1111-111111111111"}},"example":{"reference":"11111111-1111-1111-1111-111111111111","message":"Cart checkout initiated for user 11111111-1111-1111-1111-111111111111"}}}},"400":{"description":"The request is not usable, for example an unknown query parameter or a promo code that does not apply","content":{"application/json":{"schema":{"type":"object","properties":{"error_reference":{"type":"string"},"error_type":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"status_code":{"type":"integer"},"timestamp":{"type":"string"}},"additionalProperties":true,"required":["error_reference","error_type","errors","status_code","timestamp"],"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}},"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}}}},"401":{"description":"No token, an expired token, or the basket line belongs to somebody else","content":{"application/json":{"schema":{"type":"object","properties":{"error_reference":{"type":"string"},"error_type":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"status_code":{"type":"integer"},"timestamp":{"type":"string"}},"additionalProperties":true,"required":["error_reference","error_type","errors","status_code","timestamp"],"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}},"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}}}},"404":{"description":"Nothing found: no such line, an empty basket, or an unknown promo code","content":{"application/json":{"schema":{"type":"object","properties":{"error_reference":{"type":"string"},"error_type":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"status_code":{"type":"integer"},"timestamp":{"type":"string"}},"additionalProperties":true,"required":["error_reference","error_type","errors","status_code","timestamp"],"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}},"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}}}},"500":{"description":"Unexpected failure. Quote `error_reference` when reporting it","content":{"application/json":{"schema":{"type":"object","properties":{"error_reference":{"type":"string"},"error_type":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"status_code":{"type":"integer"},"timestamp":{"type":"string"}},"additionalProperties":true,"required":["error_reference","error_type","errors","status_code","timestamp"],"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}},"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"promo_code":{"type":"string"},"target_user_reference":{"type":"string"}},"additionalProperties":true,"required":["promo_code"]},"example":{"promo_code":"SAVE10"}}}}}},"/carts/checkout":{"patch":{"tags":["Carts"],"summary":"Check out the basket","description":"Publishes the whole basket, with its discount, for the checkout service to take payment. 400 when the basket is empty.\n\nA super admin may act on somebody else's basket by passing `target_user_reference`; for anybody else it is ignored. It may come in the body or the query; `target_email` (body only) goes with it.","operationId":"checkout_cart_products_carts_checkout_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"target_user_reference","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Super admin only: whose basket to act on.","title":"Target User Reference"},"description":"Super admin only: whose basket to act on."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"reference":{"type":["string","null"]},"message":{"type":"string"}},"additionalProperties":true,"required":["message"],"example":{"reference":"11111111-1111-1111-1111-111111111111","message":"Cart checkout initiated for user 11111111-1111-1111-1111-111111111111"}},"example":{"reference":"11111111-1111-1111-1111-111111111111","message":"Cart checkout initiated for user 11111111-1111-1111-1111-111111111111"}}}},"400":{"description":"The request is not usable, for example an unknown query parameter or a promo code that does not apply","content":{"application/json":{"schema":{"type":"object","properties":{"error_reference":{"type":"string"},"error_type":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"status_code":{"type":"integer"},"timestamp":{"type":"string"}},"additionalProperties":true,"required":["error_reference","error_type","errors","status_code","timestamp"],"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}},"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}}}},"401":{"description":"No token, an expired token, or the basket line belongs to somebody else","content":{"application/json":{"schema":{"type":"object","properties":{"error_reference":{"type":"string"},"error_type":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"status_code":{"type":"integer"},"timestamp":{"type":"string"}},"additionalProperties":true,"required":["error_reference","error_type","errors","status_code","timestamp"],"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}},"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}}}},"500":{"description":"Unexpected failure. Quote `error_reference` when reporting it","content":{"application/json":{"schema":{"type":"object","properties":{"error_reference":{"type":"string"},"error_type":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"status_code":{"type":"integer"},"timestamp":{"type":"string"}},"additionalProperties":true,"required":["error_reference","error_type","errors","status_code","timestamp"],"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}},"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"target_user_reference":{"type":"string"},"target_email":{"type":"string"}},"additionalProperties":true},"example":{"target_user_reference":"11111111-1111-1111-1111-111111111111","target_email":"jane@example.com"}}}}}},"/carts":{"get":{"tags":["Carts"],"summary":"The signed-in user's basket","description":"Every line with the basket's discount and totals. Ten lines a page; `page=all` for the lot. Only the parameters listed here are accepted: any other is a 400. An empty basket answers `items: {\"products\": []}`.","operationId":"get_cart_carts_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Page number, or `all` for the whole basket. Anything unusable reads as 1.","examples":["1"],"title":"Page"},"description":"Page number, or `all` for the whole basket. Anything unusable reads as 1."},{"name":"ordering","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`field` ascending, `-field` descending. Default `-created_at_timestamp`.","examples":["-price"],"title":"Ordering"},"description":"`field` ascending, `-field` descending. Default `-created_at_timestamp`."},{"name":"sorting","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`asc` or `desc`. Overrides the direction `ordering` gave.","title":"Sorting"},"description":"`asc` or `desc`. Overrides the direction `ordering` gave."},{"name":"target_user_reference","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Super admin only: whose basket to read.","title":"Target User Reference"},"description":"Super admin only: whose basket to read."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"object","properties":{"reference":{"type":["string","null"]},"email":{"type":["string","null"]},"products":{"type":"array","items":{"type":"object","properties":{"reference":{"type":"string"},"user_reference":{"type":["string","null"]},"product":{"type":["object","null"],"additionalProperties":true},"bundle":{"type":["object","null"],"additionalProperties":true},"license":{"type":["object","null"],"additionalProperties":true},"discount":{"type":["object","null"],"additionalProperties":true},"price":{"type":"number"},"metadata":{"type":"object","additionalProperties":true},"created_by_reference":{"type":["string","null"]},"created_at_timestamp":{"type":["string","null"]},"updated_by_reference":{"type":["string","null"]},"updated_at_timestamp":{"type":["string","null"]}},"additionalProperties":true,"required":["reference","price"],"example":{"reference":"33333333-3333-3333-3333-333333333333","user_reference":"11111111-1111-1111-1111-111111111111","product":{"reference":"22222222-2222-2222-2222-222222222222","product_name":"Ports"},"bundle":{"bundle_name":"Custom Bundle"},"license":{"data":[{"feature_reference":"feature-1","feature_name":"Bathymetry","feature_price":150.0}],"valid_to":"2026-06-01T00:00:00","duration":6},"discount":{},"price":150.0,"metadata":{},"created_by_reference":"11111111-1111-1111-1111-111111111111","created_at_timestamp":"2026-09-30T10:00:00","updated_by_reference":"11111111-1111-1111-1111-111111111111","updated_at_timestamp":"2026-09-30T10:00:00"}}},"discount":{"type":["object","null"],"additionalProperties":true},"metadata":{"type":["object","null"],"additionalProperties":true},"created_by_reference":{"type":["string","null"]},"created_at_timestamp":{"type":["string","null"]},"updated_by_reference":{"type":["string","null"]},"updated_at_timestamp":{"type":["string","null"]},"total_feature_quantity":{"type":["integer","null"]},"total_bundle_quantity":{"type":["integer","null"]},"total_price":{"type":["number","null"]},"total_discount":{"type":["number","null"]},"total_amount_saved":{"type":["number","null"]},"total_amount_due":{"type":["number","null"]}},"additionalProperties":true,"required":["products"]},"pagination":{"type":"object","properties":{"current_page":{"type":"integer"},"page_size":{"type":"integer"},"total_records":{"type":"integer"},"total_pages":{"type":"integer"},"has_next":{"type":"boolean"},"has_previous":{"type":"boolean"}},"additionalProperties":true,"required":["current_page","page_size","total_records","total_pages","has_next","has_previous"]}},"additionalProperties":true,"required":["items","pagination"],"example":{"items":{"reference":"11111111-1111-1111-1111-111111111111","email":"jane@example.com","products":[{"reference":"33333333-3333-3333-3333-333333333333","user_reference":"11111111-1111-1111-1111-111111111111","product":{"reference":"22222222-2222-2222-2222-222222222222","product_name":"Ports"},"bundle":{"bundle_name":"Custom Bundle"},"license":{"data":[{"feature_reference":"feature-1","feature_name":"Bathymetry","feature_price":150.0}],"valid_to":"2026-06-01T00:00:00","duration":6},"discount":{},"price":150.0,"metadata":{},"created_by_reference":"11111111-1111-1111-1111-111111111111","created_at_timestamp":"2026-09-30T10:00:00","updated_by_reference":"11111111-1111-1111-1111-111111111111","updated_at_timestamp":"2026-09-30T10:00:00"}],"discount":{"reference":"44444444-4444-4444-4444-444444444444","discount_name":"Launch offer","percentage":10.0,"value":10.0,"promo_code":"SAVE10"},"metadata":{"applied_discount_code":"SAVE10"},"created_by_reference":"11111111-1111-1111-1111-111111111111","created_at_timestamp":"2026-09-30T09:00:00","updated_by_reference":"11111111-1111-1111-1111-111111111111","updated_at_timestamp":"2026-09-30T10:00:00","total_feature_quantity":1,"total_bundle_quantity":1,"total_price":150.0,"total_discount":15.0,"total_amount_saved":15.0,"total_amount_due":135.0},"pagination":{"current_page":1,"page_size":10,"total_records":1,"total_pages":1,"has_next":false,"has_previous":false}}},"example":{"items":{"reference":"11111111-1111-1111-1111-111111111111","email":"jane@example.com","products":[{"reference":"33333333-3333-3333-3333-333333333333","user_reference":"11111111-1111-1111-1111-111111111111","product":{"reference":"22222222-2222-2222-2222-222222222222","product_name":"Ports"},"bundle":{"bundle_name":"Custom Bundle"},"license":{"data":[{"feature_reference":"feature-1","feature_name":"Bathymetry","feature_price":150.0}],"valid_to":"2026-06-01T00:00:00","duration":6},"discount":{},"price":150.0,"metadata":{},"created_by_reference":"11111111-1111-1111-1111-111111111111","created_at_timestamp":"2026-09-30T10:00:00","updated_by_reference":"11111111-1111-1111-1111-111111111111","updated_at_timestamp":"2026-09-30T10:00:00"}],"discount":{"reference":"44444444-4444-4444-4444-444444444444","discount_name":"Launch offer","percentage":10.0,"value":10.0,"promo_code":"SAVE10"},"metadata":{"applied_discount_code":"SAVE10"},"created_by_reference":"11111111-1111-1111-1111-111111111111","created_at_timestamp":"2026-09-30T09:00:00","updated_by_reference":"11111111-1111-1111-1111-111111111111","updated_at_timestamp":"2026-09-30T10:00:00","total_feature_quantity":1,"total_bundle_quantity":1,"total_price":150.0,"total_discount":15.0,"total_amount_saved":15.0,"total_amount_due":135.0},"pagination":{"current_page":1,"page_size":10,"total_records":1,"total_pages":1,"has_next":false,"has_previous":false}}}}},"400":{"description":"The request is not usable, for example an unknown query parameter or a promo code that does not apply","content":{"application/json":{"schema":{"type":"object","properties":{"error_reference":{"type":"string"},"error_type":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"status_code":{"type":"integer"},"timestamp":{"type":"string"}},"additionalProperties":true,"required":["error_reference","error_type","errors","status_code","timestamp"],"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}},"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}}}},"401":{"description":"No token, an expired token, or the basket line belongs to somebody else","content":{"application/json":{"schema":{"type":"object","properties":{"error_reference":{"type":"string"},"error_type":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"status_code":{"type":"integer"},"timestamp":{"type":"string"}},"additionalProperties":true,"required":["error_reference","error_type","errors","status_code","timestamp"],"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}},"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}}}},"500":{"description":"Unexpected failure. Quote `error_reference` when reporting it","content":{"application/json":{"schema":{"type":"object","properties":{"error_reference":{"type":"string"},"error_type":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"status_code":{"type":"integer"},"timestamp":{"type":"string"}},"additionalProperties":true,"required":["error_reference","error_type","errors","status_code","timestamp"],"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}},"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/carts/{reference}":{"get":{"tags":["Carts"],"summary":"One basket line","description":"`reference` is the basket line's own reference, not the product's.","operationId":"get_cart_product_by_reference_carts__reference__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"reference","in":"path","required":true,"schema":{"type":"string","title":"Reference"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"reference":{"type":"string"},"user_reference":{"type":["string","null"]},"product":{"type":["object","null"],"additionalProperties":true},"bundle":{"type":["object","null"],"additionalProperties":true},"license":{"type":["object","null"],"additionalProperties":true},"discount":{"type":["object","null"],"additionalProperties":true},"price":{"type":"number"},"metadata":{"type":"object","additionalProperties":true},"created_by_reference":{"type":["string","null"]},"created_at_timestamp":{"type":["string","null"]},"updated_by_reference":{"type":["string","null"]},"updated_at_timestamp":{"type":["string","null"]}},"additionalProperties":true,"required":["reference","price"],"example":{"reference":"33333333-3333-3333-3333-333333333333","user_reference":"11111111-1111-1111-1111-111111111111","product":{"reference":"22222222-2222-2222-2222-222222222222","product_name":"Ports"},"bundle":{"bundle_name":"Custom Bundle"},"license":{"data":[{"feature_reference":"feature-1","feature_name":"Bathymetry","feature_price":150.0}],"valid_to":"2026-06-01T00:00:00","duration":6},"discount":{},"price":150.0,"metadata":{},"created_by_reference":"11111111-1111-1111-1111-111111111111","created_at_timestamp":"2026-09-30T10:00:00","updated_by_reference":"11111111-1111-1111-1111-111111111111","updated_at_timestamp":"2026-09-30T10:00:00"}},"example":{"reference":"33333333-3333-3333-3333-333333333333","user_reference":"11111111-1111-1111-1111-111111111111","product":{"reference":"22222222-2222-2222-2222-222222222222","product_name":"Ports"},"bundle":{"bundle_name":"Custom Bundle"},"license":{"data":[{"feature_reference":"feature-1","feature_name":"Bathymetry","feature_price":150.0}],"valid_to":"2026-06-01T00:00:00","duration":6},"discount":{},"price":150.0,"metadata":{},"created_by_reference":"11111111-1111-1111-1111-111111111111","created_at_timestamp":"2026-09-30T10:00:00","updated_by_reference":"11111111-1111-1111-1111-111111111111","updated_at_timestamp":"2026-09-30T10:00:00"}}}},"401":{"description":"No token, an expired token, or the basket line belongs to somebody else","content":{"application/json":{"schema":{"type":"object","properties":{"error_reference":{"type":"string"},"error_type":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"status_code":{"type":"integer"},"timestamp":{"type":"string"}},"additionalProperties":true,"required":["error_reference","error_type","errors","status_code","timestamp"],"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}},"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}}}},"404":{"description":"Nothing found: no such line, an empty basket, or an unknown promo code","content":{"application/json":{"schema":{"type":"object","properties":{"error_reference":{"type":"string"},"error_type":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"status_code":{"type":"integer"},"timestamp":{"type":"string"}},"additionalProperties":true,"required":["error_reference","error_type","errors","status_code","timestamp"],"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}},"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}}}},"500":{"description":"Unexpected failure. Quote `error_reference` when reporting it","content":{"application/json":{"schema":{"type":"object","properties":{"error_reference":{"type":"string"},"error_type":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"status_code":{"type":"integer"},"timestamp":{"type":"string"}},"additionalProperties":true,"required":["error_reference","error_type","errors","status_code","timestamp"],"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}},"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Carts"],"summary":"Remove a line from the basket","description":"`reference` is the basket line's own reference. Only its owner may remove it; anybody else gets 401.","operationId":"remove_product_from_cart_carts__reference__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"reference","in":"path","required":true,"schema":{"type":"string","title":"Reference"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"reference":{"type":["string","null"]},"message":{"type":"string"}},"additionalProperties":true,"required":["message"],"example":{"reference":"11111111-1111-1111-1111-111111111111","message":"Cart checkout initiated for user 11111111-1111-1111-1111-111111111111"}},"example":{"reference":"11111111-1111-1111-1111-111111111111","message":"Cart checkout initiated for user 11111111-1111-1111-1111-111111111111"}}}},"401":{"description":"No token, an expired token, or the basket line belongs to somebody else","content":{"application/json":{"schema":{"type":"object","properties":{"error_reference":{"type":"string"},"error_type":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"status_code":{"type":"integer"},"timestamp":{"type":"string"}},"additionalProperties":true,"required":["error_reference","error_type","errors","status_code","timestamp"],"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}},"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}}}},"404":{"description":"Nothing found: no such line, an empty basket, or an unknown promo code","content":{"application/json":{"schema":{"type":"object","properties":{"error_reference":{"type":"string"},"error_type":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"status_code":{"type":"integer"},"timestamp":{"type":"string"}},"additionalProperties":true,"required":["error_reference","error_type","errors","status_code","timestamp"],"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}},"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}}}},"500":{"description":"Unexpected failure. Quote `error_reference` when reporting it","content":{"application/json":{"schema":{"type":"object","properties":{"error_reference":{"type":"string"},"error_type":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"status_code":{"type":"integer"},"timestamp":{"type":"string"}},"additionalProperties":true,"required":["error_reference","error_type","errors","status_code","timestamp"],"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}},"example":{"error_reference":"b7825cd3-59dc-43a9-9e1f-964676d3cf72","error_type":"NOT_FOUND_ERROR","errors":{"message":["Cart product not found"]},"status_code":404,"timestamp":"2026-09-30T10:00:00.000000"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"HTTPBearer":{"type":"http","description":"The access token from sign-in.","scheme":"bearer"}}}}