Delete a cart
const url = 'https://api.ebitex.io/commerce/delivery/v1/carts/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url https://api.ebitex.io/commerce/delivery/v1/carts/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --header 'Authorization: Bearer <token>'Deletes the cart and its lines. Answers 204 with no body.
A cart belongs to one shopper in one store and holds SKUs and quantities only: it never holds a price, because the server prices everything, so a client cannot name one. The shopper is proven by their visitor token, sent in X-Visitor-Token: a missing, expired, revoked or unrecognised token is 401 visitor_token_required. Another shopper’s cart, and a cart in another store, answer 404 cart_not_found. The key must carry the checkout permission (Allow carts and checkout when the key is made); a key that can only read answers 403 scope_denied. Cart responses are never cached (Cache-Control: private, no-store).
Key: commerce.checkout.write
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”Responses
Section titled “ Responses ”OK
visitor_token_required: send the shopper’s visitor token in X-Visitor-Token.
missing_api_key or invalid_api_key: no key was sent, or it is unknown, revoked or expired, or its store binding was removed.
payment_required: the organization’s subscription needs attention.
scope_denied: the key was not allowed to run carts and checkout.
scope_denied: the key lacks commerce.delivery.read. app_not_available: Commerce is not enabled for the organization. origin_denied or ip_denied: the key was used from an origin or address outside its restrictions.
cart_not_found: there is no such cart for this shopper in this store.
rate_limited: slow down; Retry-After says how long to wait.
rate_limited: the key spent its requests-per-minute budget; Retry-After says how long to wait. too_many_failed_authentications: too many bad keys from this address.