> This page is for Developer.

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

# Fulfill an order

PUT https://api.feedamp.feedonomics.com/api/v1/orders/{order-id}/fulfill

Fulfill or cancel order.
Post all fulfillments together to the Rest API for the order to move to fulfilled state.
As a PUT request, the fulfillment call fully replaces all fulfillments currently stored in FeedAMP for the particular order. New fulfillments may be added to prior ones by retrieving the fulfillments via a GET request, and then calling the PUT /fulfill endpoint with the new fulfillments added. Once all items have been fulfilled, the order will change state and no longer accept further updates.

If the order contains cancellations:
  * Cancellation Reasons must be one of the following reasons: [customer_cancelled, unable_to_ship, out_of_stock, price_error, tax_error, shipping_price_error, other].
  * _Please be aware that the use of 'other' is not recommended - some marketplaces may not accept it_.


Reference: https://docs.feedonomics.com/developer/api-reference/rest/feedamp-order-api-v1/orders/put-order-fulfill

## Authentication

- `token` header (required) — The Authentication token obtained from the get_token route.
- `x-api-key` header (required) — The SSO token obtained from the Feedonomics platform SSO token route.

## Request

### Path parameters

- `order-id` (string, required) — FeedAMP order id.

### Headers

- `token` (string, required) — The Authentication token obtained from the get_token route.
- `client` (integer, required) — The id of the client making the request.

## Response

### 200

Sample Response

- `list of OrdersOrderIdFulfillPutResponsesContentApplicationJsonSchemaItems`

## Types

### OrdersOrderIdFulfillPutResponsesContentApplicationJsonSchemaItems

- `order` (OrdersOrderIdFulfillPutResponsesContentApplicationJsonSchemaItemsOrder, optional)

### OrdersOrderIdFulfillPutResponsesContentApplicationJsonSchemaItemsOrder

- `id` (string, optional) — FeedAMP unique order id.
- `cp_order_number` (string, optional) — Seller order number.
- `state` (string, optional) — The state of the order. An order that has all items shipped or cancelled will be in the FULFILLED state.

## Examples

**Response**

```json
[
  {
    "order": {
      "id": "123",
      "cp_order_number": "1234",
      "state": "FULFILLED"
    }
  }
]
```

**SDK Code**

```python
import requests

url = "https://api.feedamp.feedonomics.com/api/v1/orders/order-id/fulfill"

headers = {
    "client": "1",
    "token": "<apiKey>"
}

response = requests.put(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.feedamp.feedonomics.com/api/v1/orders/order-id/fulfill';
const options = {method: 'PUT', headers: {client: '1', token: '<apiKey>'}};

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"
	"net/http"
	"io"
)

func main() {

	url := "https://api.feedamp.feedonomics.com/api/v1/orders/order-id/fulfill"

	req, _ := http.NewRequest("PUT", url, nil)

	req.Header.Add("client", "1")
	req.Header.Add("token", "<apiKey>")

	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.feedamp.feedonomics.com/api/v1/orders/order-id/fulfill")

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

request = Net::HTTP::Put.new(url)
request["client"] = '1'
request["token"] = '<apiKey>'

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.put("https://api.feedamp.feedonomics.com/api/v1/orders/order-id/fulfill")
  .header("client", "1")
  .header("token", "<apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.feedamp.feedonomics.com/api/v1/orders/order-id/fulfill', [
  'headers' => [
    'client' => '1',
    'token' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.feedamp.feedonomics.com/api/v1/orders/order-id/fulfill");
var request = new RestRequest(Method.PUT);
request.AddHeader("client", "1");
request.AddHeader("token", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "client": "1",
  "token": "<apiKey>"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.feedamp.feedonomics.com/api/v1/orders/order-id/fulfill")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers

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()
```