Skip to content

Hostcom Files

Stage hostcom files for delivery to RORC lanes — either by uploading a finished pipe-delimited file, or by authoring one from structured JSON rows. The file_id returned by either endpoint is the input to the fan-out hostcom_batch operation, which distributes the file to one or more store lanes.


Upload Hostcom File

Upload a finished pipe-delimited hostcom Formatter file.

POST /v1/hostcom/files

Authentication: OAuth Token (service_account or user)

Permission: rorcex:hostcom-batches.create

Request Body

Multipart form-data.

FieldTypeRequiredDescription
filefileYesA pipe-delimited hostcom Formatter file

Response

json
{
  "file_id": "hkx_00000k1L2m3N4o5",
  "original_filename": "price-update-2026-06-11.txt",
  "byte_size": 14823,
  "content_hash": "sha256:a3f1c8...",
  "created_at": "2026-06-11T14:30:00Z"
}

Status: 201 Created

FieldTypeDescription
file_idstringUnique identifier for this staged file — pass to fan-out hostcom_batch
original_filenamestringOriginal name of the uploaded file
byte_sizeintegerFile size in bytes
content_hashstringSHA-256 digest of the file contents
created_atstringISO 8601 timestamp

Errors

See Errors for shared error envelope format.


Author Hostcom File

Author a hostcom file from structured JSON rows. RORCex serialises the rows into a valid pipe-delimited Formatter file and returns a file_id you can immediately pass to fan-out.

POST /v1/hostcom/files/author

Authentication: OAuth Token (service_account or user)

Permission: rorcex:hostcom-batches.create

Request Body

Two accepted shapes — the multi-record shape is recommended for new integrations.

json
{
  "records": [
    {
      "record_type": "ProdRetail",
      "action_code": "C",
      "apply_via": "B",
      "rows": [
        { "ItemCode": "001234567890", "RetailPrice": "3.99", "... ": "..." }
      ]
    },
    {
      "record_type": "ShelfTag",
      "action_code": "A",
      "apply_via": "I",
      "rows": [
        { "ItemCode": "001234567890", "... ": "..." }
      ]
    }
  ],
  "note": "Weekly price change — June week 2"
}
FieldTypeRequiredDescription
recordsarrayYesOne or more record blocks (see below)
records[].record_typestringYesOne of the 17 registered record types (see table below)
records[].action_codestringYesA (Add), C (Change), D (Delete). ProdLabel also accepts O (Open) and L (Close)
records[].apply_viastringYesB (Batch) or I (Immediate)
records[].rowsarrayYesRow objects for this record type — see GET /v1/hostcom/record-types for the per-type row schema
notestringNoFree-text annotation stored with the file

Legacy single-record shape

json
{
  "record_type": "ProdRetail",
  "rows": [
    { "ItemCode": "001234567890", "RetailPrice": "3.99", "... ": "..." }
  ],
  "note": "Price fix"
}
FieldTypeRequiredDescription
record_typestringYesOne of the 17 registered record types
rowsarrayYesRow objects — see GET /v1/hostcom/record-types
notestringNoFree-text annotation

The legacy shape defaults action_code to C and apply_via to B. Prefer the multi-record shape for new work.

Registered Record Types

Record TypeDescription
ProdRetailRetail price maintenance
ItemDealDeal/sale pricing
DepartmentDepartment configuration
ProdMaintProduct maintenance
VendorVendor records
VendorItemVendor–item linkage
ShelfTagShelf tag printing
ProdTagLocProduct tag location
ProdLabelProduct label printing (also accepts O Open and L Close action codes)
CategoryCategory records
ProdNonRtlNon-retail product attributes
ProdTaxTax rate assignments
ProdScaleScale product configuration
PremiumPremium pricing rules
DiscountDiscount rules
DiscountDeptDepartment-level discount rules
ProdPremiumProduct–premium linkage

Row schemas — the required keys, field types, and allowed action codes for each record type are not enumerated here to avoid documentation drift. Use GET /v1/hostcom/record-types to retrieve the live machine-readable schema catalog before building author payloads.

Response

json
{
  "file_id": "hkx_00000a1B2c3D4e5",
  "generated_filename": "authored-prodretail-20260611T143000Z.txt",
  "byte_size": 3241,
  "content_hash": "sha256:b7e2d1...",
  "dedup_hit": false,
  "row_count": 47
}

Status: 201 Created

FieldTypeDescription
file_idstringUnique identifier for this staged file — pass to fan-out hostcom_batch
generated_filenamestringAuto-generated filename for the serialised Formatter file
byte_sizeintegerSize of the generated file in bytes
content_hashstringSHA-256 digest of the generated file
dedup_hitbooleantrue if identical content was already staged; the existing file_id is returned
row_countintegerTotal number of data rows across all record blocks

Errors

Validation failures return 422 hostcom_record_validation_failed. See Errors for the shared error envelope.


List Record Types

Retrieve the machine-readable schema catalog for all registered hostcom record types. Use this endpoint to discover the row schema (required keys, field types, allowed action codes) for each record type before building author payloads.

GET /v1/hostcom/record-types

Authentication: OAuth Token (service_account or user)

Permission: rorcex:hostcom-batches.view

Response

json
{
  "data": [
    {
      "record_type": "ProdRetail",
      "label": "Retail Price Maintenance",
      "allowed_actions": ["A", "C", "D"],
      "row_schema": {
        "type": "object",
        "required": ["ItemCode", "RetailPrice"],
        "properties": {
          "ItemCode": { "type": "string", "maxLength": 13 },
          "RetailPrice": { "type": "string" }
        }
      },
      "sequence_hint": 10
    }
  ]
}

Status: 200 OK

FieldTypeDescription
dataarrayOne entry per registered record type
data[].record_typestringRecord type identifier — use as record_type in author payloads
data[].labelstringHuman-readable display name
data[].allowed_actionsarrayAction codes valid for this record type (A, C, D, and for ProdLabel also O, L)
data[].row_schemaobjectJSON Schema object describing row fields — use this to validate row objects before calling author
data[].sequence_hintintegerSuggested ordering when multiple record types appear in the same file

Errors

See Errors for shared error envelope format.


Changelog
DateChange
2026-06-11Initial publication.

ShopHero CommerceCore Platform