Upload codes as SIDs directly
Overview
This method enables direct uploading of SID codes, bypassing template and workorder settings. This method is primarily intended for specific use cases and is not the recommended approach for most scenarios. The more common practice is to upload SIDs using a template.
Supported code types:
- Serialized Identifiers (SID) codes (Automatic)
Restrictions:
- Workorder settings are ignored.
For more information about different upload methods, pre-print / post-print, please refer to the overview.
API Design
Add SIDs
POST /api/v2/ingestion/codes/add-sids/
Overview
Calling this endpoint will start the code upload (ingestion) process. The ingestion process is an async process which must be validated upon completion using the record key from the response.
Please refer to the Ingestion Record documentation to see how to retrieve ingestions and check status.
Field Description
Field | Type | Description |
---|---|---|
mode | string [api, file] (Optional) | Default = api, Defines the upload mode. |
filetype | string [csv, json] (Optional) | Default = CSV, only applicable when mode = file |
default_scm_data | json (Optional) | SCM data field including product/activation_status/blacklist_reason/… Works the same as the SCM upload endpoints. Data here will be used as the default for each code (overridden by what is in the code record) |
codes | list - json (Optional*) | List of code records, may include SCM data / product etc and must include ‘id’ |
allow_posted_duplicates | bool (Optional) | Don’t error on duplicate check but ingest first entry and ignore next duplicates (within posted IDs) |
id_format | string [gs1, default] (Optional) | Default=default. ID Format for upload |
url_prefix | string (Optional) | Sets URL prefix |
printing_partner | int (Optional) | Overrides/sets printing partner. |
optional*: Only required when mode=API
Validations
Some fields are validated directly upon the API call and others are validated during processing in the background.
Validated upon API call (400 BAD REQUEST - response, ingestion aborted)
- API mode
-
- Code ID (must exist for every row), codes can not be empty
-
- SCM data for codes must be valid
-
- Duplicate checks in the codes field
- File Mode
-
- Codes can not be passed directly
- All fields are separately checked for valid input
Validated during processing (200 OK, check status using record API):
- All code ID formats
- Duplicate checks within the system + file
- All SCM data / products / related objects / ...
Example payload
{
"codes": [
{
"id": "c/01/abcde/22/dfge",
"pallet_nr": "PA01"
}
],
"default_scm_data": {
"activation_status": 1
},
"mode": "api",
"url_prefix": "https://yourdomain.com/",
"id_format": "gs1"
}
Example Response (mode API) 200 OK
{
"record_key": "3k59jyrwznhp"
}
Example Response (mode S3) 200 OK
{
"post_data": {
"url": "https://st-media-dev.s3.amazonaws.com/",
"fields": {
"Content-Type": "text/csv",
"key": "private/c/1/ingestion/code/p37bk370jurt.csv",
"AWSAccessKeyId": "AKI...",
"policy": "eyJ...",
"signature": "yc..."
}
},
"record_key": "p37bk370jurt"
}
Note: When using mode: file, the file must now be uploaded to the URL provided directly before calling /process-from-file/. Please refer to the file upload documentation for more information.
Next steps
- When using mode = file, continue uploading the file using the data returned from the API and call /process-from-file/ as described in the file upload documentation
- Check the ingestion status using the Ingestion Record API
- Use your uploaded codes