> This page is for version Prod (default).
> For other versions, use one of these documentation indexes:
> - Prod (default): https://docs.chrt.com/prod/llms.txt
> - Staging: https://docs.chrt.com/staging/llms.txt
> - Dev: https://docs.chrt.com/dev/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.chrt.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.chrt.com/_mcp/server.

# Sync one

POST https://api.chrt.com/shipping_integrations/courie/orders/sync_one/v1
Content-Type: application/json

Fetches and mirrors one Courie order by the provider's own order ID, updating the unified order list alongside it. | authz: min_org_role=operator | (CourieOrderSyncOneReq) -> (CourieOrder1)

Reference: https://docs.chrt.com/api-reference/api-reference/shipping-integrations/courie/orders/sync-one-v-1

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://api.chrt.com` (Production, default)
- `https://api.dev.chrt.com` (Development)
- `https://api.staging.chrt.com` (Staging)
- `https://localhost:8000` (Local)

## Request

### Body (application/json)

This endpoint expects an object.

- `integration_order_id` (string, required)
- `provider_org_id` (string, required) — Must be a string starting with `org_`

## Response

### 200

Successful Response

- `_id` (string, required)
- `created_at_timestamp` (datetime, required)
- `integration_order_id` (string, required)
- `mirrored_at_timestamp` (datetime, required)
- `org_id` (string, required) — Must be a string starting with `org_`
- `provider_org_id` (string, required) — Must be a string starting with `org_`
- `provider_payload` (CourieOrderResponse1, required) — One Courie order, as returned by both the list and detail endpoints. The list endpoint returns this same complete shape, so the mirror never needs a per-order detail call.
- `provider_payload_hash` (string, required)
- `schema_version` (integer, required)
- `shipping_integration` ("courie", required)
- `updated_at_timestamp` (datetime, required)

## Errors

### 422 Orders Sync One V1request Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### CourieOrderResponse1

One Courie order, as returned by both the list and detail endpoints. The list endpoint returns this same complete shape, so the mirror never needs a per-order detail call.

- `customerId` (string, required)
- `id` (string, required)
- `status` (enum, required) — Courie's own order status. The spec documents these only as a bare enum list with no per-value meaning. `IN_TRANSIT`, `ON_HOLD` and `DELETED` have not been observed live. `unified.py` derives progress from the pickup milestone rather than this field.
  - Allowed values: `CREATED`, `ASSIGNED`, `IN_TRANSIT`, `COMPLETED`, `ATTEMPTED`, `ON_HOLD`, `DELETED`, `FAILED`
- `activities` (list of CourieOrderEventResponse1, optional)
- `customFields` (list of CourieCustomFieldResponse1, optional)
- `customerCompanyName` (string, optional)
- `deliveredAt` (datetime, optional)
- `displayId` (integer, optional)
- `numPackages` (integer, optional)
- `packageDescription` (string, optional)
- `packageItems` (list of CouriePackageItemResponse1, optional)
- `packageSize` (string, optional)
- `packageTypeName` (string, optional)
- `packageWeightInPounds` (double, optional)
- `packages` (list of CouriePackageResponse1, optional)
- `pickedUpAt` (datetime, optional)
- `proofOfDeliveries` (list of CourieProofOfDeliveryResponse1, optional)
- `proofOfPickUps` (list of CourieProofOfDeliveryResponse1, optional)
- `referenceNumber` (string, optional)
- `remoteId` (string, optional)
- `serviceTypeName` (string, optional)
- `shipmentDate` (string, optional)
- `shipmentType` (string, optional)
- `statusDescription` (string, optional)
- `stops` (list of CourieStopResponse1, optional)
- `trackingNumber` (string, optional)
- `trackingUrl` (string, optional)
- `vehicleTypeName` (string, optional)

### ValidationError

- `loc` (list of LocationItem, required)
- `msg` (string, required)
- `type` (string, required)
- `ctx` (map from string to any, optional)
- `input` (any, optional)

### CourieOrderEventResponse1

- `event` (enum, required) — Activity event types. NOTE: there is no assignment event, so an order moving to `ASSIGNED` leaves no trace here and status cannot be reconstructed from this log.
  - Allowed values: `CREATED`, `PICKED_UP`, `DROPPED_OFF`, `RETURNED_TO_PICK_UP`, `ATTEMPTED`, `COMPLETED`
- `timestamp` (datetime, required)
- `address` (string, optional)

### CourieCustomFieldResponse1

- `name` (string, optional)
- `type` (string, optional)
- `value` (string, optional)

### CouriePackageItemResponse1

Per-item dimensions and weight. Values are **per piece**, not per entry: the spec's `quantity` note says "quantity 5 with weight 10 is 5 pieces weighing 50 lbs in total". Anything summing weight must multiply by `quantity` first.

- `height` (double, optional)
- `length` (double, optional)
- `quantity` (integer, optional)
- `weight` (double, optional)
- `width` (double, optional)

### CouriePackageResponse1

- `reference` (string, optional)
- `status` (string, optional)

### CourieProofOfDeliveryResponse1

- `signedBy` (string, optional)
- `timestamp` (string, optional)
- `type` (string, optional)
- `url` (string, optional)

### CourieStopResponse1

One end of a route. Timestamps here are epoch seconds, not ISO strings.

- `type` (enum, required)
  - Allowed values: `PICK_UP`, `DROP_OFF`
- `address` (CourieAddressResponse1, optional)
- `attemptedAt` (integer, optional)
- `attempts` (list of CourieStopAttemptResponse1, optional)
- `companyName` (string, optional)
- `completedAt` (integer, optional)
- `contactName` (string, optional)
- `driver` (CourieDriverResponse1, optional)
- `driverAnswers` (list of CourieDriverAnswerResponse1, optional)
- `driverStopSequenceNumber` (integer, optional)
- `due` (integer, optional)
- `instruction` (string, optional)
- `locationScans` (list of CourieLocationScanResponse1, optional)
- `orderId` (string, optional)
- `phone` (string, optional)
- `ready` (integer, optional)
- `stopSequenceNumber` (integer, optional)
- `suite` (string, optional)

### LocationItem

- string
- integer

### CourieAddressResponse1

- `city` (string, optional)
- `country` (string, optional)
- `display` (string, optional)
- `lngLat` (CourieLatLngResponse1, optional)
- `postalCode` (string, optional)
- `state` (string, optional)
- `streetAddress` (string, optional)
- `suite` (string, optional)

### CourieStopAttemptResponse1

- `date` (string, optional)
- `reason` (CourieAttemptReasonResponse1, optional)

### CourieDriverResponse1

- `firstName` (string, optional)
- `lastName` (string, optional)

### CourieDriverAnswerResponse1

- `answer` (string, optional)
- `photoUrl` (string, optional)
- `question` (string, optional)
- `type` (string, optional)

### CourieLocationScanResponse1

- `code` (string, optional)
- `scannedAt` (integer, optional)

### CourieLatLngResponse1

- `latitude` (double, optional)
- `longitude` (double, optional)
- `valid` (boolean, optional)

### CourieAttemptReasonResponse1

- `code` (string, optional)
- `name` (string, optional)

## Examples

**Request**

```json
{
  "integration_order_id": "integration_order_id",
  "provider_org_id": "provider_org_id"
}
```

**Response**

```json
{
  "_id": "_id",
  "created_at_timestamp": "2024-01-15T09:30:00Z",
  "integration_order_id": "integration_order_id",
  "mirrored_at_timestamp": "2024-01-15T09:30:00Z",
  "org_id": "org_id",
  "provider_org_id": "provider_org_id",
  "provider_payload": {
    "customerId": "customerId",
    "id": "id",
    "status": "CREATED",
    "activities": [
      {
        "event": "CREATED",
        "timestamp": "2024-01-15T09:30:00Z"
      }
    ],
    "customFields": [
      {}
    ],
    "customerCompanyName": "customerCompanyName",
    "deliveredAt": "2024-01-15T09:30:00Z",
    "displayId": 1,
    "numPackages": 1,
    "packageDescription": "packageDescription",
    "packageItems": [
      {}
    ],
    "packageSize": "packageSize",
    "packageTypeName": "packageTypeName",
    "packageWeightInPounds": 1.1,
    "packages": [
      {}
    ],
    "pickedUpAt": "2024-01-15T09:30:00Z",
    "proofOfDeliveries": [
      {}
    ],
    "proofOfPickUps": [
      {}
    ],
    "referenceNumber": "referenceNumber",
    "remoteId": "remoteId",
    "serviceTypeName": "serviceTypeName",
    "shipmentDate": "shipmentDate",
    "shipmentType": "shipmentType",
    "statusDescription": "statusDescription",
    "stops": [
      {
        "type": "PICK_UP"
      }
    ],
    "trackingNumber": "trackingNumber",
    "trackingUrl": "trackingUrl",
    "vehicleTypeName": "vehicleTypeName"
  },
  "provider_payload_hash": "provider_payload_hash",
  "schema_version": 1,
  "shipping_integration": "courie",
  "updated_at_timestamp": "2024-01-15T09:30:00Z"
}
```

**SDK Code**

```python
import requests

url = "https://api.chrt.com/shipping_integrations/courie/orders/sync_one/v1"

payload = {
    "integration_order_id": "integration_order_id",
    "provider_org_id": "provider_org_id"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.chrt.com/shipping_integrations/courie/orders/sync_one/v1';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"integration_order_id":"integration_order_id","provider_org_id":"provider_org_id"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.chrt.com/shipping_integrations/courie/orders/sync_one/v1"

	payload := strings.NewReader("{\n  \"integration_order_id\": \"integration_order_id\",\n  \"provider_org_id\": \"provider_org_id\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.chrt.com/shipping_integrations/courie/orders/sync_one/v1")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"integration_order_id\": \"integration_order_id\",\n  \"provider_org_id\": \"provider_org_id\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.chrt.com/shipping_integrations/courie/orders/sync_one/v1")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"integration_order_id\": \"integration_order_id\",\n  \"provider_org_id\": \"provider_org_id\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.chrt.com/shipping_integrations/courie/orders/sync_one/v1', [
  'body' => '{
  "integration_order_id": "integration_order_id",
  "provider_org_id": "provider_org_id"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.chrt.com/shipping_integrations/courie/orders/sync_one/v1");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"integration_order_id\": \"integration_order_id\",\n  \"provider_org_id\": \"provider_org_id\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "integration_order_id": "integration_order_id",
  "provider_org_id": "provider_org_id"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.chrt.com/shipping_integrations/courie/orders/sync_one/v1")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```