# add_project_asins

**Add project ASINs** · Changes data, reaches outside Datarova

Add up to 25 ASIN inputs to one marketplace project using current catalog and Amazon admission.

- Normalizes and deduplicates inputs, preserves variation representatives and existing attachment labels, and returns valid additions plus invalid or unresolved inputs separately.
- Capacity failure makes no additions.
- Inspect current attachments after a lost result before trying a fresh addition.

**Cost and limits:** Each successful call costs 5 credits.

## Input

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `project_id` | `integer` | Required | A marketplace project ID: `list_projects` `data.projects[].marketplaces[].project_id`, not a project group. Minimum 1. Maximum 2147483647. |
| `asins` | `string[]` | Required | Up to 25 ASIN inputs for this marketplace project. At least 1 item. At most 25 items. |
| `label_ids` | `integer[]` | Optional | Item label IDs to assign to new attachments; existing attachments keep their labels. At most 1000 items. |

## Output

Read this object from the result's `structuredContent`. The result's `content` carries a text version for the model, which is not always the same JSON.

Fields of `data`:

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `project_id` | `integer` | Required |  |
| `added_asins` | `ProjectAsinAddedResult[]` | Required | ASINs added by this request, preserving relative normalized request order. |
| `unchanged_asins` | `ProjectAsinUnchangedResult[]` | Required | ASINs or variation families already in the project, plus ASINs added by another request, preserving relative normalized request order. |
| `invalid_asins` | `ProjectAsinInvalidResult[]` | Required | Malformed, not-found, or disallowed parent identities, preserving relative normalized request order. |
| `validation_unavailable_asins` | `object[]` | Required | Items Amazon could not validate because of a temporary dependency or credential failure. Retry these identities later. |
| `primary_asin` | `string \| null` | Required | Primary ASIN after the operation. |

### `data.added_asins[]`

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `requested_asin` | `string` | Required | Normalized first-seen request identity. |
| `added_asin` | `string` | Required | The ASIN added to the project. This can differ from the requested ASIN when a parent ASIN resolves to a child ASIN. |
| `is_primary` | `boolean` | Required | Whether the stored ASIN is primary. For a removed entry, this reports its primary state before removal. |

### `data.unchanged_asins[]`

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `requested_asin` | `string` | Required | Normalized first-seen request identity. |
| `unchanged_asin` | `string` | Required | The corresponding ASIN that was not changed by the request. |
| `is_primary` | `boolean` | Required | Whether the unchanged ASIN is primary. |

### `data.invalid_asins[]`

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `requested_asin` | `string` | Required |  |
| `reason` | `string` | Required | One of `invalid_asin`, `asin_not_found`, `variation_parent_not_allowed`, `variation_parent_has_no_children`. |

### `data.validation_unavailable_asins[]`

| Name | Type | Required |
| --- | --- | --- |
| `requested_asin` | `string` | Required |
| `reason` | `"amazon_validation_unavailable"` | Required |

<details>
<summary>Full input and output JSON Schema</summary>

```json
{
  "inputSchema": {
    "type": "object",
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "properties": {
      "project_id": {
        "type": "integer",
        "minimum": 1,
        "maximum": 2147483647,
        "description": "A marketplace project ID: list_projects data.projects[].marketplaces[].project_id, not a project group."
      },
      "asins": {
        "minItems": 1,
        "maxItems": 25,
        "type": "array",
        "items": {
          "type": "string",
          "maxLength": 1024
        },
        "description": "Up to 25 ASIN inputs for this marketplace project."
      },
      "label_ids": {
        "description": "Item label IDs to assign to new attachments; existing attachments keep their labels.",
        "maxItems": 1000,
        "type": "array",
        "items": {
          "type": "integer",
          "minimum": 1,
          "maximum": 2147483647
        }
      }
    },
    "required": [
      "project_id",
      "asins"
    ],
    "additionalProperties": false
  },
  "outputSchema": {
    "type": "object",
    "required": [
      "data"
    ],
    "properties": {
      "data": {
        "type": "object",
        "required": [
          "project_id",
          "added_asins",
          "unchanged_asins",
          "invalid_asins",
          "validation_unavailable_asins",
          "primary_asin"
        ],
        "properties": {
          "project_id": {
            "type": "integer"
          },
          "added_asins": {
            "type": "array",
            "description": "ASINs added by this request, preserving relative normalized request order.",
            "items": {
              "$ref": "#/$defs/ProjectAsinAddedResult"
            }
          },
          "unchanged_asins": {
            "type": "array",
            "description": "ASINs or variation families already in the project, plus ASINs added by another request, preserving relative normalized request order.",
            "items": {
              "$ref": "#/$defs/ProjectAsinUnchangedResult"
            }
          },
          "invalid_asins": {
            "type": "array",
            "description": "Malformed, not-found, or disallowed parent identities, preserving relative normalized request order.",
            "items": {
              "$ref": "#/$defs/ProjectAsinInvalidResult"
            }
          },
          "validation_unavailable_asins": {
            "type": "array",
            "description": "Items Amazon could not validate because of a temporary dependency or credential failure. Retry these identities later.",
            "items": {
              "$ref": "#/$defs/ProjectAsinValidationUnavailableResult"
            }
          },
          "primary_asin": {
            "type": [
              "string",
              "null"
            ],
            "description": "Primary ASIN after the operation."
          }
        }
      }
    },
    "$defs": {
      "ProjectAsinAddedResult": {
        "type": "object",
        "required": [
          "requested_asin",
          "added_asin",
          "is_primary"
        ],
        "properties": {
          "requested_asin": {
            "type": "string",
            "description": "Normalized first-seen request identity."
          },
          "added_asin": {
            "type": "string",
            "description": "The ASIN added to the project. This can differ from the requested ASIN when a parent ASIN resolves to a child ASIN."
          },
          "is_primary": {
            "type": "boolean",
            "description": "Whether the stored ASIN is primary. For a removed entry, this reports its primary state before removal."
          }
        }
      },
      "ProjectAsinUnchangedResult": {
        "type": "object",
        "required": [
          "requested_asin",
          "unchanged_asin",
          "is_primary"
        ],
        "properties": {
          "requested_asin": {
            "type": "string",
            "description": "Normalized first-seen request identity."
          },
          "unchanged_asin": {
            "type": "string",
            "description": "The corresponding ASIN that was not changed by the request."
          },
          "is_primary": {
            "type": "boolean",
            "description": "Whether the unchanged ASIN is primary."
          }
        }
      },
      "ProjectAsinInvalidResult": {
        "type": "object",
        "required": [
          "requested_asin",
          "reason"
        ],
        "properties": {
          "requested_asin": {
            "type": "string"
          },
          "reason": {
            "type": "string",
            "enum": [
              "invalid_asin",
              "asin_not_found",
              "variation_parent_not_allowed",
              "variation_parent_has_no_children"
            ]
          }
        }
      },
      "ProjectAsinValidationUnavailableResult": {
        "type": "object",
        "required": [
          "requested_asin",
          "reason"
        ],
        "properties": {
          "requested_asin": {
            "type": "string"
          },
          "reason": {
            "type": "string",
            "enum": [
              "amazon_validation_unavailable"
            ]
          }
        }
      }
    }
  }
}
```

</details>
