> ## Documentation Index
> Fetch the complete documentation index at: https://docs.global-e.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GlobaleRestrictedItemsFeed

**GlobaleRestrictedItemsFeed** generates a restricted-items CSV from SFCC catalog data and uploads it to an SFTP folder configured in site preferences. Global-e retrieves the file from that location, classifies the restrictions, and returns the resulting product classification and restriction information to SFCC (imported by [GlobaleProducts](/globale-products-sfcc)).

This job is **not** part of `metadata/jobs.xml`; create it manually in Business Manager (see [Creating the job](#creating-the-job)).

See also: [Jobs overview](/jobs-sfcc), [GlobaleCatalogFeed](/globale-catalog-feed-sfcc) (catalog export), [GlobaleProducts](/globale-products-sfcc) (restriction import), [Restricted / forbidden products](/restricted-products-sfcc), [Configuration](/configuration-sfcc).

## Overview

The job processes each product created or modified since the last run and writes restriction details to a CSV file. That file is uploaded to a pre-defined SFTP folder hosted by the merchant or Global-e.

A Global-e service watches the SFTP folder and processes each new and updated restricted item through its classification procedures. A separate Global-e job then queries the Global-e API to return product classification and restriction information to SFCC.

The job has two steps:

| Step | Step type | Description |
| - | - | - |
| GenerateRestrictedItemsFeed | `custom.GlobaleGenerateRestrictedItemsFeed` | Builds the restricted-items CSV from `geRestrictedItemsFeedConfig` and writes it to the IMPEX folder |
| UploadRestrictedItemsFeed | `custom.GlobaleUploadRestrictedItemsFeed` | Uploads the generated file from IMPEX to the SFTP location configured in site preferences |

1. **GenerateRestrictedItemsFeed** — builds the CSV from site preference **Restricted Items Feed Configuration** (`geRestrictedItemsFeedConfig`) and writes it under IMPEX.
2. **UploadRestrictedItemsFeed** — uploads that file from IMPEX to the configured SFTP folder so Global-e can retrieve it.

## Creating the job

In Business Manager, create a new job with the ID **GlobaleRestrictedItemsFeed** and add the two custom steps above:

* **GenerateRestrictedItemsFeed** — add custom step `custom.GlobaleGenerateRestrictedItemsFeed`.
* **UploadRestrictedItemsFeed** — add custom step `custom.GlobaleUploadRestrictedItemsFeed`.

Assign the job flow only to Global-e operated sites. See [Configuration → Scheduled Jobs](/configuration-sfcc#scheduled-jobs-administration--operations--jobs) for Business Manager setup.

### Run in full export mode

When delta mode is enabled, the generate step processes only products whose **lastModified** system attribute changed since the last run. Price changes are stored on the **PriceBook**, not the **Product**, so products with updated prices are *not* picked up in delta mode. If your restriction logic depends on price-related conditions (see the [Source Handler](#source-handler)), always run the job in full export mode (`deltaMode.processOnlyModifiedProducts = false`).

## Report requirements

| Requirement | Value |
| - | - |
| File name | `{MerchantName}Restrictions_ddmmyyyyhhmm.csv` (merchant name from Global-e merchant settings) — e.g. `MyToysStoreRestrictions_100220151738.csv` |
| Schedule | May run at any time |
| Format | CSV |
| Upload target | Global-e SFTP, **or** the merchant's SFTP. For a merchant-hosted SFTP, Global-e requires write permissions to the manifest folder, and that folder must contain an `archive` sub-folder. |

The number of lines in the feed equals the number of SKUs, brands, or categories restricted *per country*:

* One SKU restricted in one country → one line.
* One SKU restricted in ten countries → ten lines.
* Five SKUs, one brand, and one category restricted in two countries → twelve lines (two lines each).

## Feed structure

The generated CSV has **no header row**. Columns are described below as spreadsheet columns (A, B, C, …) for clarity only.

| Column | Field | Required | Accepted values |
| - | - | - | - |
| A | SKU | Optional | Product code (SKU) provided by the merchant. Leave empty to not restrict by SKU. |
| B | Brand | Optional | Brand code as provided in the product catalog. Leave empty to not restrict by brand. |
| C | Category | Optional | Category code as provided in the product catalog. Leave empty to not restrict by category. |
| D | Restriction Flag | **Mandatory** | `1` to enforce a restriction, `0` to remove a restriction. |
| E | Country | **Mandatory** | Country ISO code (Alpha-2 or Alpha-3), or `ALL` for every country currently operated by Global-e. |
| F | State | Optional | Relevant state code. |

**Exactly one** of columns A, B, or C must be populated per line. In a mixed feed, restrict each product by only one type per line — e.g. SKU restrictions populate column A (B and C empty), category restrictions populate column C (A and B empty).

### Variations (variation masters)

For configurable products (variation masters):

* To restrict only some variations, list the SKUs of those variations.
* To restrict all variations, list the SKUs of all variations **and** the master product SKU.

### Restriction precedence

If at least one rule applies to a product (by SKU, brand, or category), the product is restricted:

* If brand `NIKE` is restricted for all countries and SKU0001 (a Nike product) is *not* restricted in France, the brand rule wins — SKU0001 stays restricted everywhere, including France.
* If brand `NIKE` is *not* restricted anywhere but SKU0001 is restricted in France, SKU0001 is restricted only in France.
* If brand `NIKE` is restricted for all countries and category `girl's shoes` is *not* restricted anywhere, all girl's-shoes products are unrestricted except those also in the Nike brand, which stay restricted everywhere.
* If category `girl's shoes` is restricted for all countries and SKU0001 (a girl's shoe) is *not* restricted in France, SKU0001 stays restricted everywhere, including France.

If a product is prohibited from being sold via Global-e, removing a per-country restriction for it has no effect — it remains restricted.

## Examples

### Standard SKU, brand, and category restrictions

Restrict SKU001 in China, Cuba, Denmark; SKU002 in China, Cuba; Brand001 in China, Cuba; Category001 in China, Cuba, Denmark, France; and remove the restriction of SKU003 in Brazil:

| A | B | C | D | E |
| - | - | - | - | - |
| SKU001 | | | 1 | CHN |
| SKU001 | | | 1 | CUB |
| SKU001 | | | 1 | DNK |
| SKU002 | | | 1 | CHN |
| SKU002 | | | 1 | CUB |
| | Brand001 | | 1 | CHN |
| | Brand001 | | 1 | CUB |
| | | Category001 | 1 | CHN |
| | | Category001 | 1 | CUB |
| | | Category001 | 1 | DNK |
| | | Category001 | 1 | FRA |
| SKU003 | | | 0 | BRA |

### Configurable product restriction

A golf glove (master SKU0001) with size (S/M/L) and hand (L/R) variations: `SKU0001SLH`, `SKU0001MLH`, `SKU0001LLH`, `SKU0001SRH`, `SKU0001MRH`, `SKU0001LRH`.

Restrict only left-hand gloves in China (3 variation SKUs):

| A | B | C | D | E |
| - | - | - | - | - |
| SKU0001SLH | | | 1 | CHN |
| SKU0001MLH | | | 1 | CHN |
| SKU0001LLH | | | 1 | CHN |

Restrict all golf gloves in China (6 variation SKUs **plus** the master SKU):

| A | B | C | D | E |
| - | - | - | - | - |
| SKU0001SLH | | | 1 | CHN |
| SKU0001MLH | | | 1 | CHN |
| SKU0001LLH | | | 1 | CHN |
| SKU0001SRH | | | 1 | CHN |
| SKU0001MRH | | | 1 | CHN |
| SKU0001LRH | | | 1 | CHN |
| SKU0001 | | | 1 | CHN |

### Country / state restrictions

Restrict SKU001 in all US states and SKU002 in NY and CA; remove the restriction for SKU003 in all US states and SKU004 in NY and CA:

| A | B | C | D | E | F |
| - | - | - | - | - | - |
| SKU001 | | | 1 | US | |
| SKU002 | | | 1 | US | NY |
| SKU002 | | | 1 | US | CA |
| SKU003 | | | 0 | US | |
| SKU004 | | | 0 | US | NY |
| SKU004 | | | 0 | US | CA |

## Configuration

Feed settings are stored in site preference **Restricted Items Feed Configuration** (`geRestrictedItemsFeedConfig`) under **Merchant Tools → Site Preferences → Custom Site Preference Groups → Global-e Catalog Jobs**.

Example configuration:

```javascript theme={null}
{
    "impex": {
        "folderPath": "/src/globale/restrictions",
        "archiveFolderPath": "/src/globale/restrictions/archive",
        "fileName": "SFCCRestrictions_{datetime}",
        "fileType": "csv"
    },
    "sftpCredentialIDs": ["Globale-SFTPRestrictionsFeedUpload"],
    "file": {
        "catalogId": "storefront-catalog-m-non-en",
        "separator": ",",
        "quote": "\"",
        "locale": "default"
    },
    "deltaMode": {
        "processOnlyModifiedProducts": true,
        "productsCountPerOneRun": 0,
        "productsStartPosition": 0
    },
    "scenarios": {
        "enabledBrandsScenario": true,
        "enabledCategoriesScenario": true,
        "enabledProductsScenario": true
    },
    "countriesExclusions": {
        "brands": {
            "brand1": "DE",
            "brand2": "EN,US,CN"
        },
        "categories": {
            "category1": "EN,CN",
            "category2": "DE,CN"
        }
    }
}
```

| Field | Type | Description | Mandatory |
| - | - | - | - |
| impex | object | IMPEX configuration | Yes |
| impex.folderPath | string | Directory where generated restriction files are stored | Yes |
| impex.archiveFolderPath | string | Directory where archived restriction files are stored | No |
| impex.fileName | string | Generated file name pattern | Yes |
| impex.fileType | string | Restriction file type | No |
| sftpCredentialIDs | array | SFCC service credential IDs used to upload the feed (e.g. `["Globale-SFTPRestrictionsFeedUpload"]`) | Yes |
| file | object | Generated file configuration | Yes |
| file.catalogId | string | Catalog ID iterated to generate the product information; defaults to all products assigned to the site | No |
| file.separator | string | Column separator | No |
| file.quote | string | Quote character | No |
| file.locale | string | SFCC locale used during generation | No |
| deltaMode | object | Delta-mode configuration | No |
| deltaMode.processOnlyModifiedProducts | boolean | Process only products modified since the last run (see the [full-export note](#run-in-full-export-mode)) | No |
| deltaMode.productsCountPerOneRun | number | Number of products to process per run (`0` = no limit) | No |
| deltaMode.productsStartPosition | number | Starting position for processing products | No |
| scenarios | object | Scenario configuration | Yes |
| scenarios.enabledBrandsScenario | boolean | Enable the brands scenario | Yes |
| scenarios.enabledCategoriesScenario | boolean | Enable the categories scenario | Yes |
| scenarios.enabledProductsScenario | boolean | Enable the products scenario | Yes |
| countriesExclusions | object | Previous restricted-country values for brands/categories (auto-populated; see below) | No |
| countriesExclusions.brands | object | Restricted countries for specific brands | No |
| countriesExclusions.categories | object | Restricted countries for specific categories | No |

## SFTP service credential

Set the SFTP credentials provided by Global-e in service credential **Globale-SFTPRestrictionsFeedUpload** (the credential ID referenced by `sftpCredentialIDs`):

**Administration → Operations → Services → Service Credentials → Globale-SFTPRestrictionsFeedUpload**

Contact Global-e for the URL, username, and password values.

## Custom object `GLOBALE_RESTRICTED_ITEMS`

The custom object `GLOBALE_RESTRICTED_ITEMS` holds the configuration used to manage the brands, categories, and products scenarios. Import `demo.customobjects.restricteditems.xml` from the `metadata` folder to create three entities:

* `brands`
* `categories`
* `products`

Each entity has two custom attributes:

### Source Handler

`Source Handler (sourceHandler)` is used exclusively by the **products** scenario to resolve the list of country codes that should be restricted for a product. It must **return a single comma-separated string of country codes**, or `ALL` when all countries are restricted — for example `"US,GB"`, `"ALL"`, or `"US_NY,US_CA"` for state restrictions. Configure it on the `GLOBALE_RESTRICTED_ITEMS` custom object entity for the products scenario (**Merchant Tools → Custom Objects → GLOBALE\_RESTRICTED\_ITEMS**).

For example, if the restricted countries are stored in a product custom attribute `restrictedCountries`, the Source Handler reads that attribute and returns the formatted string. If restrictions are stored in a different format, the Source Handler must convert them to the expected country-code string.

<Note>
  **Price-related conditions.** If the Source Handler uses price-related conditions, run the job in **full export mode** — price updates occur on the PriceBook (not the Product), so price-affected products are skipped in delta mode. See [Run in full export mode](#run-in-full-export-mode).
</Note>

### Countries Exclusions

`Countries Exclusions (countriesExclusions)` is used by the **brands** and **categories** scenarios and stores the previous restricted-country values. **You do not set this manually** — the code populates it automatically once brand and category restrictions are applied to the generated file.

## Hidden metadata

The job also uses these system object definitions, which are not assigned to any attribute group:

* **Restricted Items Last Run (`geRestrictedItemsFeedLastRun`)** — site preference holding the timestamp of the last `GlobaleRestrictedItemsFeed` run.
* **Countries Exclusions (`geCountriesExclusions`)** — product custom attribute holding the previous restricted-country values for the product (format `"US,GB"`, `"ALL"`, or `"US_NY,US_CA"` for state restrictions).
