Skip to main content

Freight Point To Point Upsert Many V1 Ep

POST 

/v1/freight/point_to_point/upsert_many

Create/Update Point to Point Rates

Creates or updates point to point freight rates in bulk. Each row is matched to an existing record by id when supplied, otherwise by its natural key (counterparty, origin, destination, ratebook type, product group). A matched record gains the supplied rate on its rate schedule, so rates can be scheduled into the future; an unmatched row creates a new record.

A row that does not match the schema below — an unrecognised unit, a missing required field — is rejected before anything is applied and the whole request fails. Past that point rows are processed independently: a row the system cannot reconcile, such as an unknown counterparty or location, is reported in errors while the remaining rows still apply.

Required Scopes (if.w)

Request​

A list of rows, each with the following attributes.

counterparty: str
Name of the counterparty the rate belongs to.


origin: str
Name of the origin location.


destination: str
Name of the destination location.


effective_from: datetime
The date this rate becomes effective. Truncated to the start of day.


rate: float | None = None
The rate value. Rounded to 5 decimal places. Required unless distance is supplied.


unit: RateUnit | None = None
Unit the rate is charged in (trucks, gallons, liters, tons). Required whenever rate is supplied.


use_surcharge: bool | None = None
Whether the freight surcharge applies to this rate. Required when creating a new record; omit to leave an existing record unchanged.


book_type: RateBookType = cost
Ratebook the rate belongs to (cost or revenue).


effective_to: datetime | None = None
The date this rate stops being effective. Leave unset for an open-ended rate.


id: str | None = None
Internal identifier of the record to update. Omit to match on the natural key.


product_group: str | None = None
Product group the rate applies to. Part of the natural key.


distance: float | None = None
Distance in miles for this rate.


tag: str | None = None
Free-text tag stored against the rate.


Response​

result: str
success, partial success, or error.


updated_count: int
Number of rows applied.


errors: list[object]
Rows that were rejected, each with a row_number (1-based position in the request) and a message.


warnings: list[object]
Rows that applied with a caveat, in the same shape as errors.

Responses​

Successful Response

{
"result": "string",
"message": "string",
"updated_count": 0,
"error_count": 0,
"errors": [
{
"row_number": 0,
"message": "string"
}
],
"warning_count": 0,
"warnings": [
{
"row_number": 0,
"message": "string"
}
]
}
Loading...