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

# Returns required custom details

GET https://onlinetools.ups.com/api/trade/compliance/v2/content/fields/customs-detail

This returns an array of fields that are required for the provided import and/or export country

Reference: https://ups.ferndocs.com/api-reference/customs-detail/field-data/get-custom-detail-data

## Authentication

- `Authorization` header (bearer token, required) — Find your Client ID and Secret on your app info page. 1. Select "Try It" 2. In the Security section enter your Client ID and Secret 3. Select "Request Token" 4. Enter any additional information in the Body and Parameters sections 5. Select "Send" to execute your API request"
- `Authorization` header (bearer token, required) — Find your Client ID and Secret on your app info page. 1. Select "Try It" 2. In the Security section enter your Client ID and Secret 3. Select "Request Token" 4. Enter any additional information in the Body and Parameters sections 5. Select "Send" to execute your API request"
- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://onlinetools.ups.com/api/trade/compliance/v2` (Production, default)
- `https://wwwcie.ups.com/api/trade/compliance/v2` (Customer Integration Environment)

## Request

### Query parameters

- `import_country_code` (string, optional, nullable)
- `export_country_code` (string, optional, nullable)
- `locale` (string, optional, default: en-US)
- `commodity_codes` (string, optional, nullable) — Optional comma-separated list of tariff codes to filter results.

### Headers

- `transId` (string, required)
- `transactionSrc` (string, required)

## Response

### 200

Success

- `commodityCodes` (list of CustomDetailsGetFieldsSuccessResponsev2CommodityCodesItems, required) — Unbounded list of commodity codes and their associated compliance Regulations.
- `fieldGroups` (list of CustomDetailsGetFieldsSuccessResponsev2FieldGroupsItems, optional) — Unbounded list of field group definitions grouped by country, shipment type, and Regulation.

## Errors

### 401 Unauthorized Error

Unauthorized

- `response` (CustomDetailsErrorResponsev2Response, required) — Response container to store errors

### 422 Unprocessable Entity Error

Unprocessable Entity

- `response` (CustomDetailsErrorResponsev2Response, required) — Response container to store errors

### 500 Internal Server Error

Server Error

- `response` (CustomDetailsErrorResponsev2Response, required) — Response container to store errors

## Types

### CustomDetailsGetFieldsSuccessResponsev2CommodityCodesItems

- `commodityCode` (string, required) — The tariff code for the product for the selected import country and process type
- `regulations` (list of CustomDetailsGetFieldsSuccessResponsev2CommodityCodesItemsRegulationsItems, required) — Regulations that require additional data for this commodity code.

### CustomDetailsGetFieldsSuccessResponsev2FieldGroupsItems

- `countryCode` (string, required) — The ISO 3166 country or territory code the fields pertain to.
- `shipmentType` (string, required) — Indicates what direction of movement the fields pertain to.
- `groupKey` (string, required) — Field group key returned by the GET endpoint used to scope the shipment metadata payload.
- `details` (string, required) — Provides details on why and when the information is needed.
- `regulation` (string, required) — Identifier for the compliance Regulation.
- `regulationSections` (list of CustomDetailsRegulationSectionv2Items, required) — Unbounded list of regulationSection definitions for this Regulation.
- `fields` (list of CustomDetailsGetFieldsSuccessResponsev2FieldGroupsItemsFieldsItems, required) — Unbounded list of individual field definitions.
- `countryName` (string, optional) — Country name the fields apply to.

### CustomDetailsErrorResponsev2Response

Response container to store errors

- `errors` (list of CustomDetailsErrorResponsev2ResponseErrorsItems, required) — Unbounded array containing one or more errors

### CustomDetailsGetFieldsSuccessResponsev2CommodityCodesItemsRegulationsItems

- `regulation` (string, required) — Identifier for the compliance Regulation.
- `regulationSections` (list of CustomDetailsRegulationSectionv2Items, required) — Unbounded list of regulationSection definitions for this Regulation.

### CustomDetailsRegulationSectionv2Items

- `sectionKey` (string, optional) — Identifier for the field. Conditionaly required when sectionName is not present.
- `sectionName` (string, optional) — Human-readable regulationSection label. Conditionally required when sectionKey is not present.

### CustomDetailsGetFieldsSuccessResponsev2FieldGroupsItemsFieldsItems

- `sectionKey` (string, required) — Identifier for the field.
- `label` (string, required) — Human-readable name of the field.
- `order` (string, required) — Display order for the field.
- `tooltip` (string, required, nullable) — Tooltip text explaining the field.
- `isRequired` (string, required) — Returns the conditionality of the field
- `fieldType` (enum, required) — The type of the field, based on available html form inputs
  - Allowed values: `textbox`, `list`, `date`, `radio`, `checkbox`, `textarea`
- `allowedValueCount` (integer, required, default: 1) — Number of occurnces allowed for this field
- `validation` (CustomDetailsGetFieldsSuccessResponsev2FieldGroupsItemsFieldsItemsValidation, required) — rule validation object
- `regulationSections` (list of CustomDetailsRegulationSectionv2Items, required) — Unbounded list of regulationSection definitions for this Regulation.
- `requirementConditions` (list of CustomDetailsGetFieldsSuccessResponsev2FieldGroupsItemsFieldsItemsRequirementConditionsItems, optional, nullable) — Unbounded array of rules. Conditionally required when is 'isRequired' flag is set.
- `keyAlias` (string, optional, nullable) — Alias used to identify the field when mapping to downstream systems.
- `level` (enum, optional) — Indicates whether the field applies at the shipment or product level.
  - Allowed values: `Shipment`, `Product`

### CustomDetailsErrorResponsev2ResponseErrorsItems

Error entity

- `code` (string, required) — code for the given message
- `message` (string, required) — the warning or error message to be conveyed
- `description` (string, optional, nullable) — Internal description of the error
- `field` (string, optional, nullable) — The path to the field causing the error as returned from the backend services.
- `value` (string, optional, nullable) — The value that caused the error

### CustomDetailsGetFieldsSuccessResponsev2FieldGroupsItemsFieldsItemsValidation

rule validation object

- `minLength` (integer, required, nullable) — The min length allowed for text fields
- `maxLength` (integer, required, nullable) — The max length allowed for text fields
- `errorMessage` (string, required, nullable) — Error Message
- `dataType` (string, required) — defines which type of values to look for
- `regexPattern` (string, optional, nullable) — A regex-based validation pattern for the field which should be applied when validating, Required when the type is 'custom'.
- `listValues` (list of CustomDetailsGetFieldsSuccessResponsev2FieldGroupsItemsFieldsItemsValidationListValuesItems, optional) — Unbounded list of string values to validate against. Required for type 'List'

### CustomDetailsGetFieldsSuccessResponsev2FieldGroupsItemsFieldsItemsRequirementConditionsItems

An object containing the specifics of each rule. Order is to be applied top-down (OR conditions align with the prior rule).

- `fieldKey` (string, required, nullable) — The key for the field that this rule is evaluating
- `operator` (string, required, nullable) — The operator used when evaluating the rule
- `value` (string, required, nullable) — The value used when evaluating the rule
- `logicalOperator` (enum, optional) — Determines how the rules are joined when evaluating the condition if there are multiple rules. Required for all rules except the first.
  - Allowed values: `AND`, `OR`

### CustomDetailsGetFieldsSuccessResponsev2FieldGroupsItemsFieldsItemsValidationListValuesItems

value to validate against

- `displayText` (string, required) — Value to display in the dropdown for consumers
- `internalValue` (string, required) — Internal value for each dropdown item that is hidden to consumers

## Examples

**Response**

```json
{
  "commodityCodes": [
    {
      "commodityCode": "2926400000",
      "regulations": [
        {
          "regulation": "FDA",
          "regulationSections": [
            {
              "sectionKey": "DRU"
            }
          ]
        }
      ]
    },
    {
      "commodityCode": "3003395000",
      "regulations": [
        {
          "regulation": "FDA",
          "regulationSections": [
            {
              "sectionKey": "DRU"
            }
          ]
        }
      ]
    }
  ],
  "fieldGroups": [
    {
      "countryCode": "US",
      "shipmentType": "Import",
      "groupKey": "US-IMP-FDA",
      "details": "This is for US import FDA fields",
      "regulation": "FDA",
      "regulationSections": [
        {
          "sectionKey": "Cos",
          "sectionName": "Cosmetics"
        },
        {
          "sectionKey": "Bio",
          "sectionName": "Biologics"
        },
        {
          "sectionKey": "Dev",
          "sectionName": "Device"
        },
        {
          "sectionKey": "Foo",
          "sectionName": "Food"
        }
      ],
      "fields": [
        {
          "sectionKey": "MnuNa",
          "label": "Manufacturer Name",
          "order": "1",
          "tooltip": "Type of shipping bill to be processed for the shipment",
          "isRequired": "C",
          "fieldType": "textbox",
          "allowedValueCount": 1,
          "validation": {
            "minLength": 1,
            "maxLength": 10,
            "errorMessage": "Enter a valid value",
            "dataType": "Text",
            "listValues": []
          },
          "regulationSections": [
            {
              "sectionKey": "Cos"
            },
            {
              "sectionKey": "Bio"
            },
            {
              "sectionKey": "Dev"
            },
            {
              "sectionKey": "Foo"
            }
          ],
          "requirementConditions": [
            {
              "fieldKey": "MnuPslCd",
              "operator": "!=",
              "value": ""
            }
          ],
          "keyAlias": "ManufacturerName",
          "level": "Product"
        },
        {
          "sectionKey": "MnuPslCd",
          "label": "Manufacturer Postal Code",
          "order": "8",
          "tooltip": "The postal code address of the manufacturer for the product",
          "isRequired": "Y",
          "fieldType": "textbox",
          "allowedValueCount": 1,
          "validation": {
            "minLength": 1,
            "maxLength": 10,
            "errorMessage": "Enter a valid value",
            "dataType": "Text",
            "listValues": []
          },
          "regulationSections": [
            {
              "sectionKey": "Cos"
            },
            {
              "sectionKey": "Bio"
            },
            {
              "sectionKey": "Dev"
            },
            {
              "sectionKey": "Foo"
            }
          ],
          "keyAlias": "ManufacturerPostalCode",
          "level": "Product"
        },
        {
          "sectionKey": "MnuAdLn1Te",
          "label": "Manufacturer Address Line 1",
          "order": "1",
          "tooltip": "Line 1 of the address of the manufacturer for the product",
          "isRequired": "N",
          "fieldType": "textbox",
          "allowedValueCount": 1,
          "validation": {
            "minLength": 1,
            "maxLength": 10,
            "errorMessage": "Enter a valid value",
            "dataType": "Text",
            "listValues": []
          },
          "regulationSections": [
            {
              "sectionKey": "Cos"
            },
            {
              "sectionKey": "Bio"
            },
            {
              "sectionKey": "Dev"
            },
            {
              "sectionKey": "Foo"
            }
          ],
          "keyAlias": "ManufacturerAddressLine1",
          "level": "Product"
        },
        {
          "sectionKey": "MnuAdLn2Te",
          "label": "Manufacturer Address Line 2",
          "order": "1",
          "tooltip": "Line 2 of the address of the manufacturer for the product",
          "isRequired": "N",
          "fieldType": "textbox",
          "allowedValueCount": 1,
          "validation": {
            "minLength": 1,
            "maxLength": 10,
            "errorMessage": "Enter a valid value",
            "dataType": "Text",
            "listValues": []
          },
          "regulationSections": [
            {
              "sectionKey": "Cos"
            },
            {
              "sectionKey": "Bio"
            },
            {
              "sectionKey": "Dev"
            },
            {
              "sectionKey": "Foo"
            }
          ],
          "keyAlias": "ManufacturerAddressLine2",
          "level": "Product"
        },
        {
          "sectionKey": "MnuAdLn3Te",
          "label": "Manufacturer Address Line 3",
          "order": "1",
          "tooltip": "Line 3 of the address of the manufacturer for the product",
          "isRequired": "N",
          "fieldType": "textbox",
          "allowedValueCount": 1,
          "validation": {
            "minLength": 1,
            "maxLength": 10,
            "errorMessage": "Enter a valid value",
            "dataType": "Text",
            "listValues": []
          },
          "regulationSections": [
            {
              "sectionKey": "Cos"
            },
            {
              "sectionKey": "Bio"
            },
            {
              "sectionKey": "Dev"
            },
            {
              "sectionKey": "Foo"
            }
          ],
          "keyAlias": "ManufacturerAddressLine3",
          "level": "Product"
        },
        {
          "sectionKey": "MnuCtyNa",
          "label": "Manufacturer City Name",
          "order": "1",
          "tooltip": "Line 3 of the address of the manufacturer for the product",
          "isRequired": "N",
          "fieldType": "textbox",
          "allowedValueCount": 1,
          "validation": {
            "minLength": 1,
            "maxLength": 10,
            "errorMessage": "Enter a valid value",
            "dataType": "Text",
            "listValues": []
          },
          "regulationSections": [
            {
              "sectionKey": "Cos"
            },
            {
              "sectionKey": "Bio"
            },
            {
              "sectionKey": "Dev"
            },
            {
              "sectionKey": "Foo"
            }
          ],
          "keyAlias": "ManufacturerAddressLine3",
          "level": "Product"
        },
        {
          "sectionKey": "MnuStPrvCd",
          "label": "Manufacturer State/Province Code",
          "order": "1",
          "tooltip": "The state/province for the address of the manufacturer for the product",
          "isRequired": "N",
          "fieldType": "textbox",
          "allowedValueCount": 1,
          "validation": {
            "minLength": 1,
            "maxLength": 10,
            "errorMessage": "Enter a valid value",
            "dataType": "Text",
            "listValues": []
          },
          "regulationSections": [
            {
              "sectionKey": "Cos"
            },
            {
              "sectionKey": "Bio"
            },
            {
              "sectionKey": "Dev"
            },
            {
              "sectionKey": "Foo"
            }
          ],
          "keyAlias": "ManufacturerStateProvinceCode",
          "level": "Product"
        },
        {
          "sectionKey": "MnuCtyCd",
          "label": "Manufacturer Country Code",
          "order": "1",
          "tooltip": "The country code for the address of the manufacturer for the product",
          "isRequired": "N",
          "fieldType": "textbox",
          "allowedValueCount": 1,
          "validation": {
            "minLength": 1,
            "maxLength": 10,
            "errorMessage": "Enter a valid value",
            "dataType": "Text",
            "listValues": []
          },
          "regulationSections": [
            {
              "sectionKey": "Cos"
            },
            {
              "sectionKey": "Bio"
            },
            {
              "sectionKey": "Dev"
            },
            {
              "sectionKey": "Foo"
            }
          ],
          "keyAlias": "ManufacturerCountryCode",
          "level": "Product"
        },
        {
          "sectionKey": "MnuPslCd",
          "label": "Manufacturer Postal Code",
          "order": "1",
          "tooltip": "The postal code address of the manufacturer for the product",
          "isRequired": "Y",
          "fieldType": "textbox",
          "allowedValueCount": 1,
          "validation": {
            "minLength": 1,
            "maxLength": 10,
            "errorMessage": "Enter a valid value",
            "dataType": "Text",
            "listValues": []
          },
          "regulationSections": [
            {
              "sectionKey": "Cos"
            },
            {
              "sectionKey": "Bio"
            },
            {
              "sectionKey": "Dev"
            },
            {
              "sectionKey": "Foo"
            }
          ],
          "keyAlias": "ManufacturerPostalCode",
          "level": "Product"
        }
      ],
      "countryName": "UNITED STATES OF AMERICA"
    }
  ]
}
```

**SDK Code**

```python Field Data_getCustomDetailData_example
import requests

url = "https://onlinetools.ups.com/api/trade/compliance/v2/content/fields/customs-detail"

headers = {
    "transId": "transId",
    "transactionSrc": "transactionSrc",
    "Authorization": "Bearer <token>"
}

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

print(response.json())
```

```javascript Field Data_getCustomDetailData_example
const url = 'https://onlinetools.ups.com/api/trade/compliance/v2/content/fields/customs-detail';
const options = {
  method: 'GET',
  headers: {
    transId: 'transId',
    transactionSrc: 'transactionSrc',
    Authorization: 'Bearer <token>'
  }
};

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

```go Field Data_getCustomDetailData_example
package main

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

func main() {

	url := "https://onlinetools.ups.com/api/trade/compliance/v2/content/fields/customs-detail"

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

	req.Header.Add("transId", "transId")
	req.Header.Add("transactionSrc", "transactionSrc")
	req.Header.Add("Authorization", "Bearer <token>")

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

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

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

}
```

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

url = URI("https://onlinetools.ups.com/api/trade/compliance/v2/content/fields/customs-detail")

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

request = Net::HTTP::Get.new(url)
request["transId"] = 'transId'
request["transactionSrc"] = 'transactionSrc'
request["Authorization"] = 'Bearer <token>'

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

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

HttpResponse<String> response = Unirest.get("https://onlinetools.ups.com/api/trade/compliance/v2/content/fields/customs-detail")
  .header("transId", "transId")
  .header("transactionSrc", "transactionSrc")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://onlinetools.ups.com/api/trade/compliance/v2/content/fields/customs-detail', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'transId' => 'transId',
    'transactionSrc' => 'transactionSrc',
  ],
]);

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

```csharp Field Data_getCustomDetailData_example
using RestSharp;

var client = new RestClient("https://onlinetools.ups.com/api/trade/compliance/v2/content/fields/customs-detail");
var request = new RestRequest(Method.GET);
request.AddHeader("transId", "transId");
request.AddHeader("transactionSrc", "transactionSrc");
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Field Data_getCustomDetailData_example
import Foundation

let headers = [
  "transId": "transId",
  "transactionSrc": "transactionSrc",
  "Authorization": "Bearer <token>"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://onlinetools.ups.com/api/trade/compliance/v2/content/fields/customs-detail")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
```