FAQ
Authentication
Why does the endpoint return 404 in my browser? The GraphQL endpoint accepts only POST. Use Postman, curl or the GraphQL Playground.
How long is the token valid? The token response contains tokenExpireOn. Use that value instead of assuming a fixed lifetime. When a request returns 401, get a new token.
Can I use the same token for the CRM & Loyalty API? Yes. One token works for both APIs in sandbox.
Customers and orders
Do I create a customer for every order? No. Run Get Customer by Name and Phone first. Call Add Customer only when items is empty. This keeps the order history of one person in one record.
An empty items array came back. Is it an error? No. It means no customer matches. Continue with Add Customer.
Why does Get Order fail on orderKey? orderKey is typed as a list ([Guid]). Send it as an array, even for one order.
How do I check that a product is in stock? Use outOfStock(location: <locationKey>) in Get Products by Product Category. Stock is resolved per location.
Where do I get countyKey, cityKey and streetKey? Run Get Counties and Cities by Country, pick a county and a city, then run Get Streets by County with their keys. Use the street publicKey as streetKey.
Can I place an order without a company invoice? Yes. invoice is optional on Add Order. When you send it, clientType is COMPANY or CUSTOMER.
A mutation returned HTTP 200 but something looks wrong. What do I check? Read errorCode, errorMessage and errorData in the mutation result. A filled errorCode means a business rule failed, even if the HTTP call succeeded.
Webhooks
How do I get notified when an order status changes, without polling? Use webhooks. In sandbox, you set them with the miscellaneous.webHooks mutations. In production, Expressoft representatives configure them for you. Contact [email protected].
What is a safe way to repeat an Add Order request? Send a key of your own in the order. If an order with this key already exists, the mutation returns the DuplicateKey error instead of creating a second order.
What happens if my endpoint is down? Expressoft expects a 2xx response. If it doesn't get one, it retries two more times, 5 seconds apart, then stops. Events missed after that aren't sent again.
Environments
What differs between sandbox and production? The URLs and the credentials are separate. In sandbox you set webhooks yourself. In production Expressoft configures them. Ask Expressoft for the production URLs when you are ready to go live.