Skip to content

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.

https://api.shypr.app/rest

Each endpoint takes and returns JSON:

POST /rest/crm/customers/create HTTP/1.1
Host: api.shypr.app
X-API-KEY: sh_...
Content-Type: application/json
  • 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 uid of the record, not the GraphQL IRI.
  • Optimistic locking. A billing record, a customer and a supplier have a version. Send the version you read in an update. If the record changed after you read it, the API answers 409 Conflict. Read the record again and retry. Leave out version to skip the check.

Create a customer:

Terminal window
curl https://api.shypr.app/rest/crm/customers/create \
-H "X-API-KEY: $SHYPR_API_KEY" \
-H "Content-Type: application/json" \
-d @customer.json

The answer holds the id of the new record. Use it in the next call:

Terminal window
curl https://api.shypr.app/rest/crm/customers/$ID/update \
-H "X-API-KEY: $SHYPR_API_KEY" \
-H "Content-Type: application/json" \
-d @customer.json

The REST reference shows the body and the answer of each endpoint, with examples.