Hansa CRM API
Standard ERP HansaWorld REST API reference for customer data retrieval
Based on the official Standard ERP (HansaWorld/Standard Books) documentation, there is no special “customer” endpoint. The register for contacts/customers is CUVc, so you stay under /api/{company}/CUVc and then limit what’s returned using query parameters. A few important points from the docs:
-
Use
rangewithsort=Codeto retrieve one customer record. Therangeparameter only works when you also specifysort. When you supply a single value in the range (no colon), the API returns only the records whose sorted‑on field equals that value. For example, to fetch customer with codeC1234from company 3, call:GET /api/3/CUVc?sort=Code&range=C1234&fields=Code,Name,Addr1,PhoneThe docs emphasise that
rangeuses an index, so this method is the fastest way to fetch a single record. This pattern is used in official examples for objects and items. -
filtercan also be used but is slower. You can filter on any header field (e.g., Code) using the syntaxfilter.Code=.... However, the documentation warns thatfilterscans all records, so it’s considerably slower than usingsort+range:GET /api/3/CUVc?filter.Code=C1234&fields=Code,Name,Addr1,Phone -
Responses contain a
urlattribute pointing to the record. When you create or update a record, the XML/JSON response includes aurlattribute such as/api/1/IVVc/10000014that uniquely identifies the record. Although the docs show this being used forPATCHrequests, you can also issue a GET request to that URL (e.g.,/api/3/CUVc/C1234) to fetch the full record. This works because the path uses the record’s primary key (Code) and is the same address you would patch if you were updating the record. -
Remember to specify your fields. If you omit the
fieldsparameter, the API returns every field, including matrix rows. You can limit the response by listing only the fields you need (comma‑separated).
So, to fetch individual customer details in the Hansa/Standard Books API, you don’t switch endpoints—you refine your query. Use ?sort=Code&range={CustomerCode} for an efficient indexed lookup, or ?filter.Code={CustomerCode} if you can’t sort on the field. The url returned in responses can also be used directly (/api/3/CUVc/{CustomerCode}) when you need to fetch or update that specific record.