Attach Supplier Locations

Attach an existing supplier to locations that are already in Epoch โ€” the post-upload counterpart to ingestion-time supplier linking. Use it when locations were uploaded without supplier data, or when a supplier must be assigned or corrected after the fact, without re-uploading.

The link written is the same one ingestion writes, so the supplier flows into any DDS built from those locations through the normal plot โ†’ shed โ†’ facility resolution.

Path parameter

ParamDescription
idThe supplier's UUID or your external_id. Resolved as a UUID first, then as your organization's external_id (supplierid).

Body

Provide location_ids and/or asset_task_ids โ€” at least one is required. Each accepts a single value or an array.

FieldTypeDescription
location_idsstring | string[]Staged-location id(s) โ€” the id field from GET /locations. Up to 500.
asset_task_idsstring | string[]Asset task id(s); attaches the supplier to every location in those uploads. Up to 500.

Behaviour

  • Latest-wins: attaching a different supplier to a location replaces the existing link.
  • Partial success: ids that don't resolve to a location visible to your organization are reported in meta.unresolved_location_ids / meta.unresolved_asset_task_ids; the request still succeeds for the ids that did resolve.
  • Scope: everything is scoped to your acting organization. As a parent organization, use x-acting-as to attach to a child organization's locations.
  • Per-request cap: each arm accepts up to 500 ids, but asset_task_ids expand to every location in those uploads. A request that resolves to more than 10,000 distinct locations is rejected with 413 PAYLOAD_TOO_LARGE before any link is written โ€” narrow the asset_task_ids / location_ids and retry.
  • 404 only when the supplier (the addressed resource) is unknown or not linked to your organization. An empty body (neither arm) is 400.

Response meta

FieldDescription
attached_staged_location_countDistinct staged-locations the supplier was linked to.
attached_location_idsResolved ids from the location_ids arm (the asset_task_ids arm contributes to the count but not this list).
unresolved_location_idslocation_ids that didn't resolve to a visible location.
unresolved_asset_task_idsasset_task_ids that resolved to no visible locations.

Required scope: parties:write