Crate & Co. Order API
v1.0.0 · Base URL https://crate-co-api.vercel.app/api
The order API for the Crate & Co. platform. Outbound endpoints are called from your Salesforce org over the `Crate_Co` Named Credential - you never paste the base URL or a token, the Named Credential supplies both. Inbound actions are invoked by Crate & Co. against autolaunched Flows you expose.
Auth. OAuth 2.0 - Client Credentials. Configure via an External Credential; Salesforce fetches and refreshes the bearer token automatically from the token endpoint https://crate-co-api.vercel.app/api/oauth/token. You never call the token endpoint from a Flow - the Named Credential supplies the token on every callout.
Outbound - called by your org
{
"productSku": "SKU-1000",
"quantity": 2,
"destination": "Austin, TX"
}201 Created
{
"trackingNumber": "APX-a1b2c3d4",
"status": "PLACED",
"orderId": "..."
}`productSku` and `quantity` are required; `quantity` must be a number, not a string. `destination` is optional. The `trackingNumber` in the response is the key for every follow-up call (check status, cancel) - not `orderId`.
400 - missing/invalid field401 - auth failed (auto-retried)
- (no body; trackingNumber in the path as a String)
200 OK
{
"trackingNumber": "APX-a1b2c3d4",
"status": "SHIPPED",
"productSku": "SKU-1000",
"quantity": 2
}You only ever see orders your own tenant placed. Reads are filtered by the identity in your bearer token, so a tracking number that belongs to another tenant (or doesn't exist) comes back 404 - never revealing that it exists.
401 - auth failed404 - unknown order (or not one of yours)
- (filter via the `status` query param)
200 OK
{
"count": 2,
"orders": [
{ "trackingNumber": "APX-a1b2c3d4", "status": "SHIPPED", "productSku": "SKU-1000", "quantity": 2, "destination": "Austin, TX" }
]
}Supported filter: `status`. Returns a `count` alongside your matching orders.
401 - auth failed
{
"status": "CANCELLED"
}200 OK
{
"trackingNumber": "APX-a1b2c3d4",
"status": "CANCELLED"
}PATCH updates part of the resource - you change status, you don't delete the record.
400 - invalid status401 - auth failed404 - unknown order (or not one of yours)
Inbound - called by Crate & Co. against your org
{ "accountName": "Northwind Traders Ltd" }{ "orderCount": 3 }Return a single integer, not a record collection.
{ "trackingNumber": "APX-SEED-1001" }{ "orderStatus": "Shipped", "orderDestination": "Denver, CO" }Filter on the business key (tracking number), not the record Id. Output variable names are the contract - your Flow must expose `orderStatus` and `orderDestination`.
{ "trackingNumber": "APX-SEED-3001", "newStatus": "Delivered" }{ "updatedStatus": "Delivered" }This writes to your records - the Flow must actually commit the change, then read the record back and return that value (not the input) as `updatedStatus`.