> For the complete documentation index, see [llms.txt](https://docs.flowretail.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flowretail.com/docs/developers/api-documentation/customer/export-customer-data-in-structured-form.md). Agents can also search and read this documentation through its [MCP server](https://docs.flowretail.com/docs/~gitbook/mcp).

# Export customer data in structured form

The customer's data export: their own record, each sales order they were party to shaped like the receipt they were given, and each service case they handed in as a summary — with the public entries from its timeline, the case's own totals, and the parts and work the customer was billed for. Orders and service cases are gathered across every store of the tenant.

It deliberately leaves out everything internal or commercial: cost prices, margins and gross profit; staff identities and who created or changed what; internal notes and internal timeline entries; credit limits and balances, price lists, payment terms and customer groups; ledger and accounting numbers; reservation, warehouse, till and payment-terminal internals; the order's warehouse handling state (orderhandlingState and orderhandlings, as against the order, delivery and settle states a receipt shows, which are carried); UI state; the service order's assets, intake form values, secrets and portal token; and integration and extension linkage ids.

JSON is the only format the export comes in: a request whose Accept header is absent, or names application/json or `*/*`, or lists application/json among its types, is served; any other Accept value is refused with a 400. The response is served as a download, with Content-Disposition attachment and a generated .json filename. Serial numbers keep the spelling of the schema they come from — serialnumber on a sales order line, serialNumber on a service order line.

Required permissions: CUSTOMER\_EXPORT

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Customer","description":"Customer"},{"name":"GDPR","description":"GDPR"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"responses":{"CustomerExportResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerExportResponseSchema"}}},"headers":{"Content-Disposition":{"description":"Marks the body as a download and names the file, as attachment; filename=\"flowretail-gdpr-export-<customer>-<timestamp>.json\".","schema":{"type":"string"}}},"description":"The customer's data export, served as a download. JSON is the only format it comes in: a request whose Accept header is absent, or names application/json or `*/*`, or lists application/json among its types, is served; any other Accept value is refused with a 400 instead."},"CustomerExportAcceptErrorResponse":{"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"logId":{"type":"string"}}}}},"description":"The Accept header asked for a format the export does not come in. JSON is the only one."}},"schemas":{"CustomerExportResponseSchema":{"title":"CustomerExportResponseSchema","type":"object","description":"The customer's data export: their own record, each sales order they were party to shaped like the receipt they were given, and each service case they handed in as a case summary.\nEach of the three is a representation of its own, assembled field by field from what the customer already knows or has a right to see, and never derived from the representations staff read — so nothing internal can reach the export by being added to a customer, an order or a service order later.\nWhat that leaves out is everything internal or commercial: cost prices, margins and gross profit; staff identities and who created or changed what; internal notes; credit limits and balances, price lists, payment terms and customer groups; ledger and accounting numbers; reservation, warehouse, till and payment-terminal internals; the order's warehouse handling state (orderhandlingState and orderhandlings); UI state; the service order's assets, intake form values, secrets and portal token; and integration and extension linkage ids.","required":["customer","orders","services"],"properties":{"customer":{"description":"The customer's own record.","allOf":[{"$ref":"#/components/schemas/CustomerExportCustomerSchema"}]},"orders":{"type":"array","description":"Every sales order the customer was party to, across all of the tenant's stores, newest first. Empty when they have never bought anything.","items":{"$ref":"#/components/schemas/CustomerExportOrderSchema"}},"services":{"type":"array","description":"Every service case the customer handed in, across all of the tenant's stores, newest first. Empty when they have never had anything serviced.","items":{"$ref":"#/components/schemas/CustomerExportServiceOrderSchema"}}}},"CustomerExportCustomerSchema":{"title":"CustomerExportCustomerSchema","type":"object","description":"The customer's record as it appears in their own data export: who they are, how they are reached, the addresses and contact people on the account, and the consents they have given or withheld.\nIt is not the customer as staff read it. The commercial and internal side of the record — the credit limit and balance, the price list, the payment terms, the customer groups, the account manager, the internal note, the ledger number and the extension linkage ids — is not in the export at all.","required":["customerUid","customerNumber","loyaltyId","customerType","displayName","firstname","lastname","companyName","email","mobile","address","postalCode","city","countryCode","vatNumber","origin","preferredLanguage","defaultStore","ehf","createdAt","lastModifiedAt","addresses","contacts","consents"],"properties":{"customerUid":{"$ref":"#/components/schemas/UID"},"customerNumber":{"type":"string","description":"The running customer number the record is known by, the same one printed on the customer's receipts and invoices. An empty string for a customer created before customer numbers were enabled, or where the tenant has no customer number series."},"loyaltyId":{"type":"string","description":"The customer's own membership identifier in the tenant's loyalty programme — their number in it, the way the customer number is their number in the tenant's customer register. An empty string when they are not a member."},"customerType":{"$ref":"#/components/schemas/CustomerTypeENUM"},"displayName":{"type":"string"},"firstname":{"type":"string"},"lastname":{"type":"string"},"companyName":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"mobile":{"type":"string"},"address":{"type":"string"},"postalCode":{"type":"string"},"city":{"type":"string"},"countryCode":{"description":"ISO 3166-1: 2 characters representation of country","type":"string"},"vatNumber":{"$ref":"#/components/schemas/VatNumberTYPE"},"origin":{"type":"string","description":"Where the record came from — the system the customer was registered in. It is in the export because where the data was collected is part of what the customer is told about their own record."},"preferredLanguage":{"description":"The language the customer has asked to be written to in, as recorded on their record. An empty string when no preference is recorded.","allOf":[{"$ref":"#/components/schemas/LanguageCode"}]},"defaultStore":{"description":"The store the customer belongs to, which is the customer's own choice of shop. null when they belong to no particular store.","allOf":[{"$ref":"#/components/schemas/CustomerStoreResponseSchema"}]},"ehf":{"description":"The customer's own electronic invoicing address and whether invoices are sent to it.","allOf":[{"$ref":"#/components/schemas/CustomerEhfResponseSchema"}]},"createdAt":{"format":"date-time","type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"addresses":{"type":"array","description":"The delivery and invoice addresses on the account. Empty when the customer has none beyond the address on the record itself.","items":{"$ref":"#/components/schemas/CustomerAddressResponseSchema"}},"contacts":{"type":"array","description":"The contact people on the account, which a company customer normally has and a private customer normally does not. Empty when there are none.","items":{"$ref":"#/components/schemas/CustomerExportContactSchema"}},"consents":{"type":"array","description":"Every consent the customer has been asked for, with the answer that stands and where it was given. Empty when they have never been asked for one.","items":{"$ref":"#/components/schemas/CustomerConsentStatusSchema"}}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"CustomerTypeENUM":{"enum":["COMPANY","PERSON","B2B"],"title":"CustomerTypeENUM","type":"string"},"EmailTYPE":{"title":"Email","type":"string"},"VatNumberTYPE":{"description":"VAT identification number for value added tax reporting purposes.","title":"VatNumber","type":"string"},"LanguageCode":{"title":"LanguageCode","description":"Lowercase two-letter ISO 639-1 language code, like nb, en or sv.","type":"string"},"CustomerStoreResponseSchema":{"title":"CustomerStoreResponseSchema","type":"object","nullable":true,"required":["name","storeUid"],"properties":{"name":{"type":"string"},"storeUid":{"$ref":"#/components/schemas/UID"}}},"CustomerEhfResponseSchema":{"title":"CustomerEhfResponseSchema","type":"object","required":["enabled","address"],"properties":{"enabled":{"type":"boolean","description":"EHF is enabled for this customer"},"address":{"type":"string","description":"EHF address"}}},"CustomerAddressResponseSchema":{"title":"CustomerAddressResponseSchema","type":"object","required":["address","city","companyName","firstname","lastname","countryCode","email","phone","postalCode","type","customerAddressUid","displayName"],"properties":{"address":{"type":"string"},"city":{"type":"string"},"companyName":{"type":"string"},"firstname":{"type":"string"},"lastname":{"type":"string"},"countryCode":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"phone":{"type":"string"},"postalCode":{"type":"string"},"type":{"$ref":"#/components/schemas/CustomerAddressTypeENUM"},"customerAddressUid":{"type":"string"},"displayName":{"type":"string"}}},"CustomerAddressTypeENUM":{"enum":["DELIVERY_ADDRESS","INVOICE_ADDRESS"],"title":"CustomerAddressTypeENUM","type":"string"},"CustomerExportContactSchema":{"title":"CustomerExportContactSchema","type":"object","description":"A contact person on the customer's account, as the export carries them. The same fields staff read, without the extension linkage ids.","required":["customerContactUid","firstname","lastname","displayName","email","mobile","address","postalCode","city","role","createdAt","lastModifiedAt"],"properties":{"customerContactUid":{"$ref":"#/components/schemas/UID"},"firstname":{"type":"string"},"lastname":{"type":"string"},"displayName":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"mobile":{"type":"string"},"address":{"type":"string"},"postalCode":{"type":"string"},"city":{"type":"string"},"role":{"$ref":"#/components/schemas/CustomerContactRoleENUM"},"createdAt":{"format":"date-time","type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"}}},"CustomerContactRoleENUM":{"title":"CustomerContactRoleENUM","type":"string","enum":["ADMIN","PURCHASER","ACCOUNTING","NONE"]},"CustomerConsentStatusSchema":{"title":"CustomerConsentStatusSchema","type":"object","required":["consentUid","name","status","source","createdAt"],"properties":{"consentUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"status":{"type":"boolean"},"source":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}}},"CustomerExportOrderSchema":{"title":"CustomerExportOrderSchema","type":"object","description":"A sales order in the customer's data export, shaped like the receipt they were given: what they bought, what it cost, what they paid with, when, and in which store.\nIt is not the order as staff read it. Costs, margins and gross profit are not in it, nor are the staff who rang it up, the till, the ledger numbers, the warehouse and reservation state, the order's warehouse handling state (orderhandlingState and orderhandlings), the internal note or the campaign machinery behind a discount. The discount the customer actually received is in the line and order totals.","required":["orderUid","orderNumber","voucherNumber","type","orderDate","validUntil","createdAt","lastModifiedAt","settledAt","currencyCode","orderState","deliveryState","settleState","note","storeName","customerAddress","invoiceAddress","totals","items","settlements"],"properties":{"orderUid":{"$ref":"#/components/schemas/UID"},"orderNumber":{"type":"string"},"voucherNumber":{"type":"string","description":"The reference to the fully settled order, which is the number printed on the customer's receipt. An empty string until the order is settled."},"type":{"description":"What the order is — an OFFER the customer was quoted, an ORDER they placed, or a PAYMENT.","allOf":[{"$ref":"#/components/schemas/OrderTypeENUM"}]},"orderDate":{"type":"string","format":"date-time","nullable":true,"description":"The date the order was placed. Set when type is ORDER, null otherwise."},"validUntil":{"type":"string","format":"date-time","nullable":true,"description":"How long the offer stood. null on an order that is not an offer."},"createdAt":{"format":"date-time","type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"settledAt":{"format":"date-time","type":"string","nullable":true,"description":"When the order was fully paid. null until the settle state is COMPLETE."},"currencyCode":{"type":"string","description":"The currency the order was priced and paid in, as an ISO 4217 code such as NOK. Every amount on the order and its lines is in the minor units of this currency."},"orderState":{"$ref":"#/components/schemas/OrderOrderStateENUM"},"deliveryState":{"$ref":"#/components/schemas/OrderDeliveryStateENUM"},"settleState":{"$ref":"#/components/schemas/OrderSettleStateENUM"},"note":{"type":"string","description":"The note on the order that is visible on the receipt. The order's internal note is not in the export. An empty string when there is no note."},"storeName":{"type":"string","description":"The store the order was placed in."},"customerAddress":{"description":"The customer's address as it stood on the order.","allOf":[{"$ref":"#/components/schemas/OrderAddressResponseSchema"}]},"invoiceAddress":{"description":"The address the order was invoiced to. Repeats customerAddress when the order carried no separate invoice address.","allOf":[{"$ref":"#/components/schemas/InvoiceAddressResponseSchema"}]},"totals":{"description":"What the order came to.","allOf":[{"$ref":"#/components/schemas/CustomerExportOrderTotalsSchema"}]},"items":{"type":"array","description":"The lines on the order — what was bought — in the order they sit on the receipt.","items":{"$ref":"#/components/schemas/CustomerExportOrderItemSchema"}},"settlements":{"type":"array","description":"Every payment recorded against the order, including ones started and never completed, oldest first. Empty when no payment has been recorded.","items":{"$ref":"#/components/schemas/CustomerExportSettlementSchema"}}}},"OrderTypeENUM":{"enum":["OFFER","ORDER","PAYMENT"],"title":"OrderTypeENUM","type":"string"},"OrderOrderStateENUM":{"description":"|ENUM | Description |\n| --- | --- |\n| OPEN | Order is open and beeing edited by someone|\n| PARKED | Order is parked|\n| CANCELED | Order is canceled/deleted|\n| COMPLETE | Order is complete|\n| CONFIRMED | Order is confirmed|\n","enum":["OPEN","PARKED","CANCELED","COMPLETE","CONFIRMED"],"title":"OrderOrderStateENUM","type":"string"},"OrderDeliveryStateENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NOT_STARTED | Delivery not started|\n| IN_PROGRESS | Delivery is in progress. Some order lines are still reserved|\n| COMPLETE | Delivery is complete. All order lines are delivered|","enum":["NOT_STARTED","IN_PROGRESS","COMPLETE"],"title":"OrderDeliveryStateENUM","type":"string"},"OrderSettleStateENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NOT_STARTED | Settlement not started|\n| IN_PROGRESS | Settlement is in progress and the order cannot be changed|\n| COMPLETE | Settlement is complete|","enum":["NOT_STARTED","IN_PROGRESS","COMPLETE"],"title":"OrderSettleStateENUM","type":"string"},"OrderAddressResponseSchema":{"title":"OrderAddressResponseSchema","type":"object","required":["address","city","companyName","countryCode","email","firstname","lastname","mobile","postalCode","displayName"],"properties":{"address":{"type":"string"},"city":{"type":"string"},"companyName":{"type":"string"},"countryCode":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"firstname":{"type":"string"},"lastname":{"type":"string"},"mobile":{"type":"string"},"postalCode":{"type":"string"},"vatNumber":{"$ref":"#/components/schemas/VatNumberTYPE"},"displayName":{"type":"string"}},"description":""},"InvoiceAddressResponseSchema":{"title":"InvoiceAddressResponseSchema","allOf":[{"$ref":"#/components/schemas/BaseAddressSchema"},{"required":["displayName","customerAddressUid","address","city","companyName","countryCode","email","mobile","firstname","lastname","postalCode"],"properties":{"displayName":{"type":"string"},"customerAddressUid":{"$ref":"#/components/schemas/OptionalUID"}}}],"type":"object"},"BaseAddressSchema":{"title":"BaseAddressSchema","type":"object","properties":{"address":{"type":"string"},"city":{"type":"string"},"companyName":{"type":"string"},"countryCode":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"mobile":{"type":"string"},"firstname":{"type":"string"},"lastname":{"type":"string"},"postalCode":{"type":"string"}}},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"CustomerExportOrderTotalsSchema":{"title":"CustomerExportOrderTotalsSchema","type":"object","description":"What an order in the data export came to, in the figures a receipt states. The cost total, the gross profit amount and the gross profit percentage that staff read on the same order are not in the export.","required":["subtotal","totalDiscount","totalVat","grandTotal","specifiedVat"],"properties":{"subtotal":{"type":"integer","description":"The order before discount and VAT. In minor units of the order's currency: 150 is 1,50."},"totalDiscount":{"type":"integer","description":"The discount given on the order as a whole. In minor units of the order's currency: 150 is 1,50."},"totalVat":{"type":"integer","description":"The VAT charged on the order. In minor units of the order's currency: 150 is 1,50."},"grandTotal":{"type":"integer","description":"What the customer owed for the order, discount and VAT included. In minor units of the order's currency: 150 is 1,50."},"specifiedVat":{"type":"array","description":"The VAT charged, broken down by rate, as it is specified on the receipt.","items":{"$ref":"#/components/schemas/OrderTotalsVatSpecificationSchema"}}}},"OrderTotalsVatSpecificationSchema":{"description":"","properties":{"vatAmount":{"description":"Total amount with this vatRate.","type":"integer"},"vatDescription":{"description":"Description of vat rate.","type":"string"},"vatRate":{"description":"VatRate in percentage.","type":"integer"}},"required":["vatRate","vatAmount","vatDescription"],"title":"OrderTotalsVatSpecificationSchema","type":"object"},"CustomerExportOrderItemSchema":{"title":"CustomerExportOrderItemSchema","type":"object","description":"A line on an order in the data export: the product, how much of it, what it cost and what was delivered or credited.\nThe cost price, the gross profit, the ledger and VAT-code references, the warehouse and reservation state, the internal line information and the staff who sold it are not in the export.","required":["note","name","sku","serialnumber","quantityOrdered","quantityDelivered","quantityCredited","itemPrice","originalItemPrice","totalDiscountAmount","totalVatAmount","totalPrice"],"properties":{"name":{"type":"string"},"sku":{"type":"string"},"note":{"type":"string","description":"The note printed on the receipt beside this line, as the customer read it. An empty string when the line carries none."},"serialnumber":{"type":"string","description":"The serial number of the unit the customer received. An empty string when the product carries none."},"quantityOrdered":{"type":"integer","description":"In hundredths (100 = 1 unit)."},"quantityDelivered":{"type":"integer","description":"In hundredths (100 = 1 unit)."},"quantityCredited":{"type":"integer","description":"In hundredths (100 = 1 unit)."},"itemPrice":{"type":"integer","description":"The price of a single unit as it was charged. In minor units of the order's currency: 150 is 1,50."},"originalItemPrice":{"type":"integer","description":"The price of a single unit before any discount, which is what a reduction on the receipt is stated against. In minor units of the order's currency: 150 is 1,50."},"totalDiscountAmount":{"description":"Discount amount for all units on this line. In minor units of the order's currency: 150 is 1,50.","type":"integer"},"totalVatAmount":{"description":"Vat amount for all units on this line. In minor units of the order's currency: 150 is 1,50.","type":"integer"},"totalPrice":{"description":"Total price for all units on this line. In minor units of the order's currency: 150 is 1,50.","type":"integer"}}},"CustomerExportSettlementSchema":{"title":"CustomerExportSettlementSchema","type":"object","description":"A payment on an order in the data export: what was paid, with which method, in which currency and when.\nThe till it was rung up on, the staff member who took it, the ledger numbers, the payment configuration and the terminal and processor traffic behind it are not in the export.","required":["settlementName","amount","currency","state","createdAt","settledAt","externalPaymentReference","receiptText"],"properties":{"settlementName":{"type":"string","description":"The payment method as the customer sees it named."},"amount":{"type":"integer","description":"What this payment came to. In minor units of the order's currency: 150 is 1,50."},"currency":{"description":"What was handed over in a foreign currency, and the rate it was converted at. null on a payment made in the store's own currency, which is the ordinary case.","allOf":[{"$ref":"#/components/schemas/CustomerExportSettlementCurrencySchema"}]},"state":{"description":"Whether the payment went through. The payment processor's own status — authorized, captured, refunded and the rest — is not in the export.","allOf":[{"$ref":"#/components/schemas/SettlementStateENUM"}]},"createdAt":{"format":"date-time","type":"string"},"settledAt":{"format":"date-time","type":"string","nullable":true,"description":"When the payment was settled. null while it is still in progress."},"externalPaymentReference":{"type":"string","description":"The external payment reference for this payment, which on an invoice is the KID the customer paid with. An empty string when there is none."},"receiptText":{"type":"string","maxLength":500,"description":"The text printed on the receipt for this payment method. An empty string when none is configured, when it is suppressed for this settlement type, or when it has been cleared."}}},"CustomerExportSettlementCurrencySchema":{"title":"CustomerExportSettlementCurrencySchema","type":"object","nullable":true,"description":"A payment made in a currency other than the store's own: what was handed over, in which currency, and the rate it was converted at. It is null on a payment in the store's own currency, which is the ordinary case — the amount on the payment is then the whole story.","required":["amount","code","exchangeRate"],"properties":{"amount":{"type":"integer","description":"What was handed over, in the minor units of the currency named in code: 150 is 1,50."},"code":{"type":"string","description":"The currency it was paid in, as an ISO 4217 code such as EUR."},"exchangeRate":{"type":"integer","description":"The rate it was converted at."}}},"SettlementStateENUM":{"enum":["NOT_STARTED","IN_PROGRESS","COMPLETE","TERMINATED"],"title":"SettlementCodeENUM","type":"string"},"CustomerExportServiceOrderSchema":{"title":"CustomerExportServiceOrderSchema","type":"object","description":"A service case in the customer's data export, shaped like a case summary: the number they quote when they call, what they brought in and what they said was wrong with it, where the case stands, when it was expected to be ready, the price the work was estimated at, the ceiling they agreed to, and the deductible and the claim number they carried on an insurance claim, and the parts and work they were billed for.\nIt is not the service order as staff read it, and it is not the service portal page either. Cost prices and margins, the staff assigned to the case, who created or changed it, the workshop's job types and priority, the intake form values, the secrets, the assets and the portal token are none of them in the export.","required":["serviceOrderUid","serviceNumber","externalSalesOrderNumber","title","description","serviceTypeName","serviceStatusLabel","serviceState","coverage","storeName","createdAt","lastModifiedAt","readyAtEstimate","estimatedPrice","maxPrice","deductible","claimNumber","totals","items","events","salesOrderUids"],"properties":{"serviceOrderUid":{"$ref":"#/components/schemas/UID"},"serviceNumber":{"type":"string","description":"The running service number the case is known by — what the customer quotes when they call the store."},"externalSalesOrderNumber":{"type":"string","description":"The order number of the sales order the unit was bought on, in the shop's order system, as it is recorded on the case — not the service number. An empty string when the case names none."},"title":{"type":"string","description":"What the case is about, in the words it was registered with."},"description":{"type":"string","description":"The fault as it was described at intake — the customer's own account of what was wrong. An empty string when nothing was written down."},"serviceTypeName":{"type":"string","description":"The kind of service the case was taken in as."},"serviceStatusLabel":{"type":"string","description":"Where the case stands, in the wording meant for the customer: the status's customer-visible label, falling back to the internal name of the status when the tenant has set no customer-visible label for it."},"serviceState":{"description":"The stage the case is at, as the platform understands it. It follows the state behind the status, so renaming a status does not change it.","allOf":[{"$ref":"#/components/schemas/ServiceStateENUM"}]},"coverage":{"description":"Who pays for the work on the case, and under what right — the customer, or a consumer claim, a warranty claim or an insurance claim — as it stood when the export was made. It can be reclassified while the case runs.","allOf":[{"$ref":"#/components/schemas/ServiceOrderCoverageENUM"}]},"storeName":{"type":"string","description":"The store that holds the case — the one the customer collects from."},"createdAt":{"type":"string","format":"date-time"},"lastModifiedAt":{"type":"string","format":"date-time"},"readyAtEstimate":{"type":"string","format":"date-time","nullable":true,"description":"When the work was estimated to be ready. null when no date was given. A value that reads 23:59:59 on the clock in the tenant's timezone, whatever its milliseconds, means by the end of that day with no time given; any other value is the time that was given. It follows the rule readyAtEstimate on ServiceOrderResponseSchema states."},"readyAtNeeded":{"type":"string","format":"date-time","nullable":true,"deprecated":true,"description":"Deprecated. New service orders never carry it: the service module follows readyAtEstimate alone. Returned from the stored value on service orders registered before the change, null otherwise. It will be removed after the announced deprecation window; see the deprecation log for the date."},"requiresPriceEstimate":{"type":"boolean","deprecated":true,"description":"Deprecated. New service orders never carry it: asking the customer what the work will cost before it is started is the quote. Returned from the stored value on service orders registered before the change, false otherwise, and no longer in the required set. It will be removed after the announced deprecation window; see the deprecation log for the date."},"estimatedPrice":{"type":"integer","description":"What the work was estimated to cost. 0 when no estimate was captured. In minor units of the tenant's currency: 150 is 1,50."},"maxPrice":{"type":"integer","description":"The ceiling the customer allowed the work to be done up to without being asked again. 0 when no ceiling was captured. In minor units of the tenant's currency: 150 is 1,50."},"deductible":{"type":"integer","description":"The deductible on an insurance claim, VAT included, as the case recorded it for information. 0 when there is none. In minor units of the tenant's currency: 150 is 1,50."},"claimNumber":{"type":"string","description":"The number the insurer gave the claim on an insurance case. An empty string when there is none."},"totals":{"description":"What the case came to.","allOf":[{"$ref":"#/components/schemas/CustomerExportServiceOrderTotalsSchema"}]},"items":{"type":"array","description":"The parts and the work the customer was billed for, in the order they sit on the bill. Empty when nothing was put on the case.","items":{"$ref":"#/components/schemas/CustomerExportServiceOrderItemSchema"}},"events":{"type":"array","description":"The customer-visible notes from the case's history, oldest first: the timeline entries whose visibility is PUBLIC, as written. Empty when the case has none.","items":{"$ref":"#/components/schemas/CustomerExportServiceEventSchema"}},"salesOrderUids":{"type":"array","description":"The sales orders the case was billed to, by uid. A sale billed to this customer is found in the export's own orders list by its orderUid; a sale billed to a customer the case named before is not. Empty when the work was never billed to a sales order.","items":{"$ref":"#/components/schemas/UID"}}}},"ServiceStateENUM":{"title":"ServiceStateENUM","description":"Where a service order stands, as the platform understands it. Every status a tenant defines maps to exactly one state, and it is the state Flow reasons about: the workspace filters, the wording the portal shows the customer and the turnaround figures all follow the state rather than the name the status was given.\nAWAITING_PRODUCT: the service order is registered, but the device has not arrived yet.\nNOT_STARTED: the device is here and the work is queued.\nIN_TRANSIT: the service order is in a box on its way between locations.\nIN_PROGRESS: the work is being done.\nWAITING_CUSTOMER: waiting for an answer from the customer — never for the device, which is what AWAITING_PRODUCT is for.\nWAITING_SUPPLIER: waiting for parts or for an answer from a supplier.\nREADY_FOR_PICKUP: the outcome is ready to be handed over.\nCOMPLETE: the customer has the device back. This is the handover, never the payment.\nCANCELLED: the service order ended without a completed repair.\nCOMPLETE and CANCELLED are the terminal states.\nThe states are owned by the platform: tenants never define or rename them, and only decide which state each of their own statuses maps to. A status that exists today keeps the state it has until the tenant remaps it — nothing is remapped for them.\nExtensible — new states may be added, so clients must not fail on a value they do not know.","type":"string","enum":["AWAITING_PRODUCT","NOT_STARTED","IN_TRANSIT","IN_PROGRESS","WAITING_CUSTOMER","WAITING_SUPPLIER","READY_FOR_PICKUP","COMPLETE","CANCELLED"]},"ServiceOrderCoverageENUM":{"title":"ServiceOrderCoverageENUM","description":"Who pays for the work on a service order, and under what right. Every service order carries a coverage: it is chosen at intake, and it can be changed while the case runs — a diagnosis may reclassify it, as when water damage voids a warranty and the case becomes payable.\nPAYABLE: the customer pays. CONSUMER_CLAIM: a claim under statutory consumer rights — the seller's cost. WARRANTY_CLAIM: a claim under a warranty — the seller's or the manufacturer's cost. INSURANCE_CLAIM: a claim to an insurer — the service order names the insurer and may carry the insurer's claim number and the deductible, recorded for information.\nPricing, quoting and invoicing work the same way whatever the coverage is: the sale is billed to the service order's customer on every coverage (see post-serviceorders-orders). A covered repair can still carry billable work.\nExtensible — new coverages may be added, so clients must not fail on a value they do not know.","type":"string","enum":["PAYABLE","CONSUMER_CLAIM","WARRANTY_CLAIM","INSURANCE_CLAIM"]},"CustomerExportServiceOrderTotalsSchema":{"title":"CustomerExportServiceOrderTotalsSchema","type":"object","description":"What a service case in the data export came to: what was taken from stock for the work, everything else billed on the case, and the sum of the two. The field names are the export's own: the service order serves the same two figures as goodsTotal and otherTotal.","required":["grandTotal","partsTotal","workTotal"],"properties":{"grandTotal":{"type":"integer","description":"The two figures below added together — what the case came to. In minor units of the tenant's currency: 150 is 1,50."},"partsTotal":{"type":"integer","description":"What was taken from tracked stock for the work — the figure the service order serves as goodsTotal, under the name this export has carried. In minor units of the tenant's currency: 150 is 1,50."},"workTotal":{"type":"integer","description":"Everything else billed on the case, which is labour and any goods the tenant does not track in stock — the figure the service order serves as otherTotal, under the name this export has carried. In minor units of the tenant's currency: 150 is 1,50."}}},"CustomerExportServiceOrderItemSchema":{"title":"CustomerExportServiceOrderItemSchema","type":"object","description":"A part or a piece of work billed on a service case in the data export. The cost price, the warehouse it was taken from and the staff who put it on the case are not in the export.","required":["name","sku","quantity","price","originalPrice","totalPrice","serialNumber"],"properties":{"name":{"type":"string"},"sku":{"type":"string"},"quantity":{"type":"integer","description":"In hundredths (100 = 1 unit)."},"price":{"type":"integer","description":"The price of a single unit as it was charged. In minor units of the tenant's currency: 150 is 1,50."},"originalPrice":{"type":"integer","description":"The price of a single unit before any reduction, which is what a reduction on the bill is stated against — the same fact originalItemPrice carries on a sales order line. In minor units of the tenant's currency: 150 is 1,50."},"totalPrice":{"type":"integer","description":"Total price for all units on this line. In minor units of the tenant's currency: 150 is 1,50."},"serialNumber":{"type":"string","description":"The serial number of the part that was fitted to the device. An empty string when the part carries none."}}},"CustomerExportServiceEventSchema":{"title":"CustomerExportServiceEventSchema","type":"object","description":"One customer-visible note from a service case's history: the timeline entries whose visibility is PUBLIC, each with the moment it was written and its note. It carries no entry type and no amounts.\nIt carries what was written and when. The staff member behind it, the status it moved the case to, and every internal entry stay out of the export.","required":["createdAt","note"],"properties":{"createdAt":{"type":"string","format":"date-time","description":"When the entry was written."},"note":{"type":"string","description":"The text of the entry as it was written — the update the workshop left for the customer. An empty string on an entry that records only that something happened."}}}}},"paths":{"/tenants/{tenantUid}/customers/{customerUid}/export":{"get":{"description":"The customer's data export: their own record, each sales order they were party to shaped like the receipt they were given, and each service case they handed in as a summary — with the public entries from its timeline, the case's own totals, and the parts and work the customer was billed for. Orders and service cases are gathered across every store of the tenant.\n\nIt deliberately leaves out everything internal or commercial: cost prices, margins and gross profit; staff identities and who created or changed what; internal notes and internal timeline entries; credit limits and balances, price lists, payment terms and customer groups; ledger and accounting numbers; reservation, warehouse, till and payment-terminal internals; the order's warehouse handling state (orderhandlingState and orderhandlings, as against the order, delivery and settle states a receipt shows, which are carried); UI state; the service order's assets, intake form values, secrets and portal token; and integration and extension linkage ids.\n\nJSON is the only format the export comes in: a request whose Accept header is absent, or names application/json or `*/*`, or lists application/json among its types, is served; any other Accept value is refused with a 400. The response is served as a download, with Content-Disposition attachment and a generated .json filename. Serial numbers keep the spelling of the schema they come from — serialnumber on a sales order line, serialNumber on a service order line.\n\nRequired permissions: CUSTOMER_EXPORT","operationId":"tenant-customer-data-export","responses":{"200":{"$ref":"#/components/responses/CustomerExportResponse"},"400":{"$ref":"#/components/responses/CustomerExportAcceptErrorResponse"}},"summary":"Export customer data in structured form","tags":["Customer","GDPR"]}}}}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flowretail.com/docs/developers/api-documentation/customer/export-customer-data-in-structured-form.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
