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

# Reject offers

POST https://lastmile.milenow.com/index.php/api/v1/partners/transporters/offers/reject
Content-Type: application/json

Transporter token. Rejects one or more offers. Each trip moves on to the next transporter in the company list.

Reference: https://docs.milenow.com/ftl-trips/api-reference/transporter-api/reject-transporter-offers

## Authentication

- `Authorization` header (bearer token, required) — Send `Authorization: Bearer <token>`. Company endpoints take the company API token from `POST /api/v1/partners/login`. `/transporters` endpoints take the transporter token from `POST /api/v1/partners/transporters/login`. You can also send the token as an `access_token` query parameter or body field.

## Request

### Body (application/json)

This endpoint expects an OfferIdsRequest.

- `offer_ids` (list of integer, required) — Offer ids from the offers list (not trip ids).

## Response

### 200

Success

- `status` (integer, required)
- `msg` (string, required)
- `msgs` (list of string, required)
- `data` (RejectTransporterOffersData, required)

## Errors

### 401 Unauthorized Error

Missing, invalid or expired token.

- `status` (integer, required) — Same as the HTTP status code.
- `msg` (string, required) — Summary of the problem. When there are several problems it says how many.
- `msgs` (list of string, required) — Every problem found. Validation lists all problems at once, so fix them all before you retry.
- `data` (list of any, required) — Always an empty list on errors.

### 409 Conflict Error

No offer could be rejected.

- `status` (integer, required) — Same as the HTTP status code.
- `msg` (string, required) — Summary of the problem. When there are several problems it says how many.
- `msgs` (list of string, required) — Every problem found. Validation lists all problems at once, so fix them all before you retry.
- `data` (list of any, required) — Always an empty list on errors.

### 412 Precondition Failed Error

`offer_ids` is not a list of ids.

- `status` (integer, required) — Same as the HTTP status code.
- `msg` (string, required) — Summary of the problem. When there are several problems it says how many.
- `msgs` (list of string, required) — Every problem found. Validation lists all problems at once, so fix them all before you retry.
- `data` (list of any, required) — Always an empty list on errors.

### 429 Too Many Requests Error

Rate limit reached. Wait `Retry-After` seconds.

- `status` (integer, required) — Same as the HTTP status code.
- `msg` (string, required) — Summary of the problem. When there are several problems it says how many.
- `msgs` (list of string, required) — Every problem found. Validation lists all problems at once, so fix them all before you retry.
- `data` (list of any, required) — Always an empty list on errors.

## Types

### RejectTransporterOffersData

- `rejected_trip_ids` (list of integer, optional)
- `failed` (list of OfferFailure, optional)

### OfferFailure

- `offer_id` (integer, optional)
- `trip_id` (integer, optional, nullable)
- `reason` (string, optional) — `Offer not found`, `Offer is no longer open`, `Time to accept has run out` or `Trip was assigned to someone else`.

## Examples

**Request**

```json
{
  "offer_ids": [
    43
  ]
}
```

**Response**

```json
{
  "status": 200,
  "msg": "Rejected 1 trip.",
  "msgs": [],
  "data": {
    "rejected_trip_ids": [
      414
    ],
    "failed": []
  }
}
```

**SDK Code**

```python Example
import requests

url = "https://lastmile.milenow.com/index.php/api/v1/partners/transporters/offers/reject"

payload = { "offer_ids": [43] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Example
const url = 'https://lastmile.milenow.com/index.php/api/v1/partners/transporters/offers/reject';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"offer_ids":[43]}'
};

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

```go Example
package main

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

func main() {

	url := "https://lastmile.milenow.com/index.php/api/v1/partners/transporters/offers/reject"

	payload := strings.NewReader("{\n  \"offer_ids\": [\n    43\n  ]\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 Example
require 'uri'
require 'net/http'

url = URI("https://lastmile.milenow.com/index.php/api/v1/partners/transporters/offers/reject")

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  \"offer_ids\": [\n    43\n  ]\n}"

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

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

HttpResponse<String> response = Unirest.post("https://lastmile.milenow.com/index.php/api/v1/partners/transporters/offers/reject")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"offer_ids\": [\n    43\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://lastmile.milenow.com/index.php/api/v1/partners/transporters/offers/reject', [
  'body' => '{
  "offer_ids": [
    43
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Example
using RestSharp;

var client = new RestClient("https://lastmile.milenow.com/index.php/api/v1/partners/transporters/offers/reject");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"offer_ids\": [\n    43\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Example
import Foundation

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

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

let request = NSMutableURLRequest(url: NSURL(string: "https://lastmile.milenow.com/index.php/api/v1/partners/transporters/offers/reject")! 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()
```