REST
The REST API holds most of the writes: create and update invoices, quotes, sales orders, customers, suppliers, products, packing lists and shipments. Read data with GraphQL.
Base URL
Section titled “Base URL”https://api.shypr.app/restEach endpoint takes and returns JSON:
POST /rest/crm/customers/create HTTP/1.1Host: api.shypr.appX-API-KEY: sh_...Content-Type: application/jsonConventions
Section titled “Conventions”- Writes use
POST. A path ends with the action:/create,/{id}/update,/{id}/cancel. - Ids are UUIDs. In a REST path and body, an id is the
uidof the record, not the GraphQL IRI. - Optimistic locking. A billing record, a customer and a supplier have a
version. Send theversionyou read in an update. If the record changed after you read it, the API answers409 Conflict. Read the record again and retry. Leave outversionto skip the check.
Example
Section titled “Example”Create a customer:
curl https://api.shypr.app/rest/crm/customers/create \ -H "X-API-KEY: $SHYPR_API_KEY" \ -H "Content-Type: application/json" \ -d @customer.jsonThe answer holds the id of the new record. Use it in the next call:
curl https://api.shypr.app/rest/crm/customers/$ID/update \ -H "X-API-KEY: $SHYPR_API_KEY" \ -H "Content-Type: application/json" \ -d @customer.jsonThe REST reference shows the body and the answer of each endpoint, with examples.