Vault API
The Vault API covers inventory Tradepost holds at a facility on your behalf: finding what you hold, recording which of your end users each unit belongs to, and shipping units back out.
Two records per unit
A vaulted unit is described by two rows, and the distinction matters for every call in this section.
| What it is | What it answers | |
|---|---|---|
| Inventory line item | The unit you own | What is it, and is it tradable? |
| Facility item | Where that unit physically sits | Where is it, and can it ship? |
They are one-to-one: a line item has at most one placement. The line item is the stable identifier every operation takes; the placement describes where that unit currently is.
A unit is vaulted when it has a placement in state VAULTED. Nothing else means vaulted.
Placement states
| State | Meaning | Outtake allowed |
|---|---|---|
VAULTED | Held at the facility | Yes |
OUTTAKING | Outtake in flight, physically leaving | No |
UNVAULTED | Removed from the facility | No |
SOLD | Sold while at the facility | No |
TRANSFERRED | Moved to another facility | No |
CONSIGNED | Held, being sold on consignment | No |
LOANED | Temporarily loaned out | No |
HELD | Held for authentication or verification | No |
DAMAGED | Damaged while at the facility | No |
Queries
| Query | Purpose |
|---|---|
listFacilityItems | Page your placements, filtered by facility, state or end user |
getFacilityItem | Fetch one placement |
getOuttakeRequests | List outtake requests still in progress |
getOuttakeRequest | One outtake request in full, shipping side included |
previewOuttakeFees | Quote a selection's outtake fees before requesting |
Mutations
| Mutation | Purpose |
|---|---|
setFacilityItemExternalUsers | Record which of your end users each unit belongs to |
requestFacilityLineItemOuttake | Ship units back out, by line item or by end user |
cancelOuttakeRequest | Cancel a request and return its units to the sellable pool |
Every operation is scoped to your account. Ids you don't own, or that have no placement, are returned in unmatchedLineItemIds rather than failing the request.
Typical flow
listFacilityItems what do I hold?
↓
setFacilityItemExternalUsers whose is it?
↓
requestFacilityLineItemOuttake ship it back
↓
getOuttakeRequests where is it now?
Adding inventory
Coming soon.