> This page is for API Reference.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://fiftytwo-demo.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://fiftytwo-demo.ferndocs.com/_mcp/server.

# About the Basket API

Basket API, or **52API BASKET**, is a REST interface over HTTP(S) that takes a
basket and returns what it costs. Its value is that it makes discounts work
exactly the way they do at a regular till.

It is part of the **52MASTERPRICER** suite.

## Characteristics

From the specification:

* Stateless REST interface
* No persistence of basket or receipt
* Multiple 52ViKING tills can serve calls, allowing load balancing and scale
* Each till has a single article import and database, with multiple execution
  threads
* Accepts and returns **XML or JSON**

> **Note**
>
> Because it is stateless and free of side effects, Basket API doubles as a test
> harness: it is a good way to assert pricing behaviour automatically, which the
> spec calls out explicitly.

## CalculateBasket

```
POST /basket/calculatebasket/{paramChain}/{paramStore}
```

Called whenever a receipt is to be calculated. The calculation logic is
controlled by 52ViKING, and all discounts are applied to articles eligible for
discount.

### Receipts are line-orientated

A line can hold one or more single articles. Articles may be sold one-by-one or
by quantity, and **either way the lines are neither collapsed nor expanded**. A
quantity of three is one line, not three.

> **Warning**
>
> Chain and store both matter. Promotions are configured per store, so the store
> number in the path determines the answer you get. A wrong-but-valid store
> number is the usual explanation for the API disagreeing with a till.

## Next

#### [Price a basket from a webshop](/docs/guides/price-a-basket)

Where to call it from, and how to verify it matches.

#### [Discount types](/help/concepts/discount-types)

Every discount shape the engine evaluates.