> 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.

# Report errors encountered when processing a seller-initiated refund

POST https://marketplace-order-api.feedamp.feedonomics.com/api/v1/orders/{mp_order_number}/refunds/{feedamp_refund_id}/errors
Content-Type: application/json

When the market encounters errors when processing a seller initiated-refund, this endpoint allows the marketplace to report error(s) for the refund

Reference: https://docs.feedonomics.com/developer/api-reference/rest/feed-amp-order-source-api/refunds/report-refund-error

## Authentication

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

## Request

### Path parameters

- `mp_order_number` (string, required) — The unique Id for an order that is generated by the marketplace
- `feedamp_refund_id` (string, required) — The unique Id for an order line that is generated by the marketplace

### Body (application/json)

This endpoint expects a list of RefundError.

- `list of RefundError`

## Response

### 204

Error reported

## Errors

### 400 Bad Request Error

The request could not be completed

- `list of ReportedError`

### 401 Unauthorized Error

Invalid token

- `error` (string, optional) — Message describing the authentication failure

### 404 Not Found Error

The order could not be found in the systems

- `message` (string, optional) — Error message

## Types

### RefundError

A refund validation error from the marketplace

- `code` (enum, required) — Code to uniquely identify the type of error
  - Allowed values: `FULL_REFUND_REQUIRED`, `EXCESS_ITEM_REFUND`, `EXCESS_SHIPPING_REFUND`, `INVALID_CURRENCY`, `INVALID_DISCOUNT_REFUND`, `INVALID_ITEM_REFUND INVALID_INVALID_ITEM_TAX_REFUND`, `INVALID_REFUND_REASON`, `INVALID_QUANTITY`, `INVALID_SHIPPING`, `INVALID_SHIPPING_TAX_REFUND`, `LINE_ALREADY_REFUNDED`, `MP_LINE_NUMBER_DOES_NOT_EXIST`
- `message` (string, required) — An error message that which will help seller identify the cause of the error and correct the issue.

### ReportedError

- `code` (enum, required) — Code to uniquely identify the type of error
  - Allowed values: `INVALID_STATUS`
- `message` (string, required) — The error message for the error code
- `debug` (list of map from string to any, optional)

## Examples

**Request**

```json
[
  {
    "code": "EXCESS_ITEM_REFUND",
    "message": "Requested refund amount (100.99) exceeds the line's cost (75.99)"
  }
]
```

**SDK Code**

```python
import requests

url = "https://marketplace-order-api.feedamp.feedonomics.com/api/v1/orders/mp_order_number/refunds/feedamp_refund_id/errors"

payload = [
    {
        "code": "EXCESS_ITEM_REFUND",
        "message": "Requested refund amount (100.99) exceeds the line's cost (75.99)"
    }
]
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://marketplace-order-api.feedamp.feedonomics.com/api/v1/orders/mp_order_number/refunds/feedamp_refund_id/errors';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '[{"code":"EXCESS_ITEM_REFUND","message":"Requested refund amount (100.99) exceeds the line\'s cost (75.99)"}]'
};

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://marketplace-order-api.feedamp.feedonomics.com/api/v1/orders/mp_order_number/refunds/feedamp_refund_id/errors"

	payload := strings.NewReader("[\n  {\n    \"code\": \"EXCESS_ITEM_REFUND\",\n    \"message\": \"Requested refund amount (100.99) exceeds the line's cost (75.99)\"\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
require 'uri'
require 'net/http'

url = URI("https://marketplace-order-api.feedamp.feedonomics.com/api/v1/orders/mp_order_number/refunds/feedamp_refund_id/errors")

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  {\n    \"code\": \"EXCESS_ITEM_REFUND\",\n    \"message\": \"Requested refund amount (100.99) exceeds the line's cost (75.99)\"\n  }\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://marketplace-order-api.feedamp.feedonomics.com/api/v1/orders/mp_order_number/refunds/feedamp_refund_id/errors")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("[\n  {\n    \"code\": \"EXCESS_ITEM_REFUND\",\n    \"message\": \"Requested refund amount (100.99) exceeds the line's cost (75.99)\"\n  }\n]")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://marketplace-order-api.feedamp.feedonomics.com/api/v1/orders/mp_order_number/refunds/feedamp_refund_id/errors', [
  'body' => '[
  {
    "code": "EXCESS_ITEM_REFUND",
    "message": "Requested refund amount (100.99) exceeds the line\'s cost (75.99)"
  }
]',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://marketplace-order-api.feedamp.feedonomics.com/api/v1/orders/mp_order_number/refunds/feedamp_refund_id/errors");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "[\n  {\n    \"code\": \"EXCESS_ITEM_REFUND\",\n    \"message\": \"Requested refund amount (100.99) exceeds the line's cost (75.99)\"\n  }\n]", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  [
    "code": "EXCESS_ITEM_REFUND",
    "message": "Requested refund amount (100.99) exceeds the line's cost (75.99)"
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://marketplace-order-api.feedamp.feedonomics.com/api/v1/orders/mp_order_number/refunds/feedamp_refund_id/errors")! 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()
```