> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cdslogistics.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Order Information

# Authentication

The Order Information API uses an OAuth2 Identity Provider and bearer tokens.

All API calls require a valid token.

You may use any OAuth2-compliant library such as IdentityModel for .NET.

## Token Request

Send a `POST` request to the Identity Provider:

```text theme={null}
POST https://id-dev.cdslogistics.net/connect/token
```

### Required Fields

| Field          | Value                                                         | Purpose                        |
| :------------- | :------------------------------------------------------------ | :----------------------------- |
| grant\_type    | client\_credentials                                           | Machine‑to‑machine OAuth2 flow |
| scope          | order\_information\_api:orders order\_information\_api:audits | Grants access to API scopes    |
| client\_id     |                                                               | Your organization's API key    |
| client\_secret |                                                               | Secure secret (store safely)   |
| response\_type | token                                                         | Returns an access token        |

## Example Token Request

```text theme={null}
curl --location 'https://id-dev.cdslogistics.net/connect/token' \
 --header 'Content-Type: application/x-www-form-urlencoded' \
 --data-urlencode 'grant_type=client_credentials' \
 --data-urlencode 'scope=order_information_api:orders order_information_api:audits' \
 --data-urlencode 'client_id=[YOUR CLIENT ID]' \
 --data-urlencode 'client_secret=[YOUR CLIENT SECRET]' \
 --data-urlencode 'response_type=token'
```

## Token Response

| Property      | Purpose                      |
| :------------ | :--------------------------- |
| access\_token | Token used for requests      |
| expires\_in   | Lifetime in seconds          |
| token\_type   | Always Bearer                |
| scope         | API scopes included in token |

## Example Token Response

```text theme={null}
{
  "access_token": "[TOKEN STRING]",
  "expires_in": 3600,
  "token_type": "Bearer",
  "scope": "order_information_api:orders order_information_api:audits"
}
```

## Using the Token

Every request must include:

```text theme={null}
Authorization: Bearer <AccessToken>
```

Missing or expired tokens return 401 Unauthorized.

# Application Services

Base URL:

```text theme={null}
https://api-dev.cdslogistics.net/OrderInformationApi
```

Notes:

* Only orders associated with your client are returned.
* 404 returned when an order cannot be located.
* Null fields are not serialized.

# Order Statuses

| **Status Code** | **Description** |
| :-------------- | :-------------- |
| STD             | Started         |
| AVL             | Available       |
| PLN             | Planned         |
| DSO             | Dispatched      |
| CMP             | Completed       |
| CAN             | Cancelled       |

# POD Folder Types

| **Folder Type** | **Description**          |
| :-------------- | :----------------------- |
| AT              | Attempt                  |
| BOL             | Bill of Lading           |
| DAM             | Damaged                  |
| DMB             | Damaged Bulk Item        |
| DML             | Damaged Item - Loading   |
| DMR             | Damaged Item - Receiving |
| DOC             | Miscellaneous Document   |
| INB             | Inbound                  |
| LD              | Loading                  |
| LFF             | Load Feedback Form       |
| LS              | Load Shifted             |
| MAN             | Manifest                 |
| OOS             | Out of Sequence          |
| ORD             | Attended Delivery        |
| OVR             | Overage                  |
| POD             | Proof of Delivery        |
| PS              | Packing Slips            |
| RF              | Refused Freight          |
| RLD             | Receiving Load           |
| SOI             | Short on Inbound         |
| SV              | Stacking Violation       |
| TD              | Trailer Defect           |
| UN              | Unattended               |
| UNS             | Manual Scan              |

# Response Object Structures

Below are the object definitions used throughout the API.

## Order Object

| Property              | Type           | Description                        |
| :-------------------- | :------------- | :--------------------------------- |
| OrderNumber           | int            | Unique order identifier            |
| CRN                   | string         | Customer Resource Number           |
| PO                    | array          | List of associated purchase orders |
| BOL                   | string         | Bill of Lading                     |
| Consignee             | Contact Object | Delivery recipient                 |
| Carrier               | Contact Object | Transport provider                 |
| Manufacturer          | Contact Object | Manufacturer information           |
| Facility              | Contact Object | Facility details                   |
| DeliveryType          | string         | Delivery Type                      |
| DateImported          | datetime       | Import timestamp                   |
| DateEstimatedReceive  | datetime       | Estimated receive date             |
| DateReceived          | datetime       | Actual received date               |
| ReceivedById          | string         | ID of receiver                     |
| DateRequestedDelivery | datetime       | Requested delivery date            |
| DateScheduledDelivery | datetime       | Scheduled delivery date            |
| DateLoaded            | datetime       | Load date                          |
| LoadedById            | string         | ID of loader                       |
| DateActualDelivery    | datetime       | Final delivery date                |
| DeliveredBy           | string         | Delivery executor                  |
| StatusId              | string         | STD, AVL, PLN, DSO, CMP, CAN       |
| Status                | string         | Status description                 |
| Brand                 | string         | Brand name                         |
| Remarks               | string         | Order-level notes                  |
| Notes                 | array          | Order notes                        |
| Commodities           | array          | Commodity details                  |
| ProofOfDelivery       | array          | POD documents                      |
| IsReceived            | bool           | Indicates if received              |
| IsDelivered           | bool           | Indicates if delivered             |

## Contact Object

| Property | Type           | Description      |
| :------- | :------------- | :--------------- |
| Id       | string         | Identifier       |
| Name     | string         | Contact name     |
| Phone    | string         | Contact phone    |
| Email    | string         | Contact email    |
| Address  | Address Object | Physical address |

## Address Object

| Property       | Type   | Description    |
| :------------- | :----- | :------------- |
| StreetAddress1 | string | Address line 1 |
| StreetAddress2 | string | Address line 2 |
| StreetAddress3 | string | Address line 3 |
| City           | string | City           |
| State          | string | State          |
| ZipCode        | string | Postal code    |

## Note Object

| Property    | Type     | Description            |
| :---------- | :------- | :--------------------- |
| Text        | string   | Note text              |
| CreatedDate | datetime | Timestamp when created |

## Commodity Object

| Property      | Type   | Description             |
| :------------ | :----- | :---------------------- |
| CommodityCode | string | e.g., Cabinet, CABPARTS |
| Description   | string | Commodity description   |
| Count         | number | Quantity                |

## Proof of Delivery Object

| Property    | Type     | Description  |
| :---------- | :------- | :----------- |
| Filename    | string   | File name    |
| Url         | string   | Download URL |
| CreatedDate | datetime | Timestamp    |
| Folder      | string   | Image folder |

## Audit Structure

| Property      | Type   | Description      |
| :------------ | :----- | :--------------- |
| auditId       | number | Audit identifier |
| auditFacility | string | Facility audited |
| auditType     | string | Audit type       |
| auditVendor   | string | Vendor name      |
| auditScore    | double | Score            |
| auditDate     | number | Audit date       |

## Audit Detail Structure

| Property          | Type     | Description       |
| :---------------- | :------- | :---------------- |
| auditId           | number   | Audit identifier  |
| auditType         | string   | Audit type        |
| auditorName       | string   | Name of auditor   |
| auditorEmail      | string   | Auditing email    |
| orderNumber       | string   | Order audited     |
| cmpAWCDomicle     | string   | Facility domicile |
| auditDate         | datetime | Audit date/time   |
| auditScore        | number   | Score             |
| detailName        | string   | Question ID       |
| detailDescription | string   | Question text     |
| detailValue       | string   | Answer            |
| imageUrl          | string   | Link to image     |

# Requesting a Single Order

```text theme={null}
GET /orders/{OrderNumber}
```

Returns full detail including POs, notes, commodities, and POD.

### Example

```text theme={null}
curl --location 'https://api.cdslogistics.net/OrderInformationApi/orders/7432288' \
 --header 'Authorization: Bearer [TOKEN]'
```

# Requesting Open Orders

```text theme={null}
GET /orders/open
```

Returns open orders from the past 7 days.

Notes:

* Notes & POD excluded by default
* Date range may be overridden

# Requesting Completed Orders

```text theme={null}
GET /orders/completed
```

Returns completed orders from past 7 days.

# Optional Query String Parameters

| Parameter          | Purpose                                                                                                                                                                |
| :----------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| IncludePOs         | Include purchase orders                                                                                                                                                |
| IncludeCommodities | Include commodities                                                                                                                                                    |
| IncludeNotes       | Include notes                                                                                                                                                          |
| IncludePOD         | Include POD images                                                                                                                                                     |
| StartDate          | Start date for date range filter for open and completed orders<br />Open Orders filtered by Order Imported Date<br />Completed Orders filtered by Order Delivered Date |
| EndDate            | End date for date range filter for open and completed orders<br />Open Orders filtered by Order Imported Date<br />Completed Orders filtered by Order Delivered Date   |

### Date Range Rules

* Max date range: 1 year
* Default: last 7 days
* Start defaults to 7 days prior at midnight
* End defaults to today at 23:59:59

# Requesting Audit Information

```text theme={null}
GET /audit?StartDate=YYYY-MM-DD&EndDate=YYYY-MM-DD
```

Returns audits within specified date range.

# Requesting Audit Detail

```text theme={null}
GET /audit/{AuditId}
```

Returns detailed audit information including questions, answers, and image URLs.

# Download Audit Images

```text theme={null}
GET /download/audit/{Filename}
```

Returns raw image file.

# Requesting Overage Information

```text theme={null}
GET /overage/{LoadId}
GET /overage?LoadId={LoadId}
```

Returns items marked as overage on a load.
