# Vigo / Pallet Track API (v1)

Source: `Vigo Rest Services v4.1.pdf` in this folder.

## Base URLs

- UAT root: `https://api-uat.vigocloud.com/api/v1`
- Live root: defined by Vigo per customer account.

## Authentication

- All calls require API key query parameter: `code={apiKey}`
- API keys are environment-specific (UAT and Live keys differ).

## Core Endpoints

All paths below are relative to API root.

### Consignments

- `POST /consignments?code={apiKey}`
	- Create consignment.
- `PUT /consignments/{trackingcode}?code={apiKey}`
	- Update consignment.
- `DELETE /consignments/{trackingcode}?code={apiKey}`
	- Delete consignment.
- `GET /consignments/{trackingcode}?code={apiKey}`
	- Get full consignment details.

### Labels

- `GET /consignments/{trackingcode}/labels?code={apiKey}`
	- Returns base64-encoded PDF payload.

### ETA

- `GET /consignments/eta?code={ApiKey}&trackingCode={trackingCode}`
- `GET /consignments/eta?code={ApiKey}&consignmentNumber={consignmentNumber}`
- `GET /consignments/eta?code={ApiKey}&customerReference1={customerReference1}`
- `GET /consignments/eta?code={ApiKey}&customerReference2={customerReference2}`
- Optional history: append `includeAll=true`
- Date range: `GET /consignments/eta?code={apiKey}&from={fromTimestamp}&to={toTimestamp}`

### Tracking Status (Pallet Track)

- `GET /consignments/status?code={ApiKey}&trackingCode={trackingCode}`
- `GET /consignments/status?code={ApiKey}&consignmentNumber={consignmentNumber}`
- `GET /consignments/status?code={ApiKey}&customerReference1={customerReference1}`
- `GET /consignments/status?code={ApiKey}&customerReference2={customerReference2}`
- Date range: `GET /consignments/status?code={apiKey}&from={fromTimestamp}&to={toTimestamp}`

### Images (POD / Signature / Photos)

- Image IDs by reference:
	- `GET /consignments/images?code={ApiKey}&trackingCode={trackingCode}`
	- `GET /consignments/images?code={ApiKey}&consignmentNumber={consignmentNumber}`
	- `GET /consignments/images?code={ApiKey}&customerReference1={customerReference1}`
	- `GET /consignments/images?code={ApiKey}&customerReference2={customerReference2}`
- Filter types:
	- `...&includePod=true`
	- `...&includePhoto=true`
	- `...&includePod=true&includePhoto=true`
- Date range:
	- `GET /consignments/images?code={apiKey}&from={fromTimestamp}&to={toTimestamp}`
- Fetch image data from returned UID:
	- `GET /consignments/images?code={apiKey}&imageType={imageType}&uId={UID}`

### Configuration

- `GET /consignments/configurationsettings?code={apiKey}`

### Customer Paperwork

- `POST /consignments/images?code={apiKey}`

## Timestamp Format

- Use UTC format: `yyyy-MM-dd'T'HH:mm:ss.SSS'Z'`
- Example: `2021-07-01T14:59:55.711Z`

## Response Behavior

- HTTP `200`: success.
- HTTP `400`: validation/data issue.
- HTTP `401`: invalid key.
- HTTP `403`: key valid but permission/resource denied.
- HTTP `404`: resource not found.
- HTTP `5xx`: server error.

## Notes

- Track and persist `TrackingCode` from successful consignment creation; it is required for updates, labels, tracking, and related GET operations.
- Timestamp-based pull requests are rate-limited in the document context (one request per API key per hour for timestamp-based polling).