> For the complete documentation index, see [llms.txt](https://docs.fact-finder.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fact-finder.com/integration/generic-integration-topics/using-the-predictive-basket.md).

# Using the Predictive basket

Returning customers are valuable for every online shop, especially when they show regular purchasing behavior. Predictive Basket recognizes those patterns and suggests likely repeat purchases in advance.

The technical documentation of the REST API is available within the Search application at `[your NG server]/fact-finder/swagger-ui.html`. You can also access a public example here:

> Example: <https://ng-demo.fact-finder.de/fact-finder/swagger-ui.html>

## Supplying the Predictive Basket with Data

To set up the Predictive Basket with your product information, provide sales data in a structured CSV file.

If you follow the recommendations below, the export file can usually be imported into Predictive Basket with minimal adjustments. If you cannot provide this exact structure, it is often still possible to work with a different format by creating an import routine.

Please note the following when creating the export file:

* Create the export file in CSV text format, with fields separated by a delimiter such as semicolon or tab
* If possible, use UTF-8 character encoding. If you use a different encoding, let us know
* Create a new row for each product (record) purchased
* Each row must contain the same number of fields
* Ensure that the chosen separator does not appear in the order data itself. Otherwise, the field structure will be interpreted incorrectly during import
* There must be no column separator at the beginning and end of each line, unless the first or last field is present but empty in some records. If a middle field is to remain empty, the separator must still be written (example: `content1;content2;;content4;` — five fields; fields three and five are empty)
* The first line of the CSV file must contain the field names. The structure is identical to the data lines (see example below)

## Example data structure without field delimitation

```language-plaintext
Bestellnummer;Verkaufsdatum;Kundennummer;Produktnummer;Menge;Preis

02101;2020-04-02T15:20+01:00;0023928;23899823;1;699.00

02102;2020-04-02T15:20+01:00;0034228;23892326;2;199.00

02103;2020-04-02T15:20+01:00;0123421;23899854;1;849.00

...
```

## Example data structure with field delimiters

```language-plaintext
"Bestellnummer";"Verkaufsdatum";"Kundennummer";"Produktnummer";"Menge";"Preis"

"02101";"2020-04-02T15:20+01:00";"0023928";"23899823";"1";"699.00"

"02102";"2020-04-02T15:20+01:00";"0034228";"23892326";"2";"199.00"

"02103";"2020-04-02T15:20+01:00";"0123421";"23899854";"1";"849.00"

...
```

## Additional Information

To present a complete result later, provide the following information. Fields marked with an asterisk (\*) are mandatory.

The field names below are recommendations. Naming is not case sensitive. Following these recommendations allows importing the export file into the Predictive Basket with minimal adjustments.

* Order number\*\
  This information is important to clearly assign the records. The order number field should be the first field in your export.
* Date of sale\*\
  The date of sale is required as a timestamp according to ISO 8601. Alternatively, you can provide the date in the format `YYYYmmdd`.
* Customer number\*\
  Enter a customer ID here; this can be anonymized. However, the customer ID must remain the same across sessions.
* Product number\*\
  Unique ID of the purchased product.
* Quantity\*\
  Quantity of the product purchased as an integer.
* Price\
  The valid price for the product. The field should not contain any currency symbols and should use the same decimal separator throughout. The decimal separator must be a period, not a comma. There must be no thousands separator. Example: `99`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.fact-finder.com/integration/generic-integration-topics/using-the-predictive-basket.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
