Skip to main content

Stocky Full Import

The Stocky full import brings your supplier and purchase order data from Stocky into Order Engine. It runs automatically in four steps, each building on the one before it. The process is safe to re-run — it will not create duplicates.

What Happens During a Full Import

The import runs four steps in order. If any step fails, the remaining steps are skipped and the import is marked as failed.

Step 1: Supplier Import

Pulls all of your suppliers from Stocky. Existing suppliers are updated with any changes; new suppliers are added. If two suppliers happen to share the same name, the system automatically adds a suffix to keep them distinct.

Step 2: Purchase Order Import

Pulls your complete purchase order history from Stocky, including all line items on each order. Like suppliers, existing purchase orders and line items are updated only when data has changed, and new ones are added. A raw copy of the Stocky response is archived for audit purposes.

Some purchase orders in Stocky reference a vendor by name rather than by supplier ID. This step matches those vendor names to the suppliers imported in Step 1 and links them together. If a vendor name does not match any known supplier, a new supplier record is created automatically.

Why you may see two supplier records for the same company: Stocky can track the same real-world supplier under two different identifiers — a supplier ID (used on most purchase orders) and a vendor name (used on some purchase orders that lack a supplier ID). When both exist, Order Engine creates separate supplier records for each. This is by design: one supplier record holds the costs from purchase orders linked by supplier ID, and the other holds costs from purchase orders linked by vendor name. The name match is exact (case-sensitive), so "Agron" and "agron" are treated as separate suppliers.

Step 4: Generate Supplier Cost Records

Looks at every delivered purchase order line item and uses it to set the supplier cost on the corresponding product variant in Order Engine. If a line item references a product that has not yet been synced into Order Engine, it is skipped and counted separately.

Reading the Import Results

When the import finishes, each step reports a status and a set of counters. Here is what they mean.

Supplier Import

FieldMeaning
StatusWhether the step completed successfully or failed.
Imported AtWhen the supplier import finished.
PagesHow many pages of supplier data were fetched from Stocky.
FetchedTotal number of suppliers returned by Stocky.
CreatedSuppliers that were added as new records.
UpdatedSuppliers that already existed and were refreshed with updated data.
SkippedSuppliers that could not be processed (for example, missing an ID).

Created + Updated + Skipped should equal Fetched. If all suppliers already exist, you will see Updated equal to Fetched and Created at zero — this is normal for repeat imports.

Purchase Order Import

FieldMeaning
StatusWhether the step completed successfully or failed.
Imported AtWhen the purchase order import finished.
PO CountTotal number of purchase orders returned by Stocky.
POs CreatedPurchase orders that were added as new records.
POs UpdatedPurchase orders that already existed and had changes applied.
POs UnchangedPurchase orders that already existed with identical data — nothing was written.
Line Item CountTotal number of line items across all purchase orders.
Line Items CreatedLine items that were added as new records.
Line Items UpdatedLine items that already existed and had changes applied.
Line Items UnchangedLine items that already existed with identical data — nothing was written.

POs Created + POs Updated + POs Unchanged should equal PO Count, and the same holds for line items. On the very first import, everything will show as Created. On subsequent runs, most records will be Unchanged unless something was modified in Stocky since the last import.

FieldMeaning
StatusWhether the step completed successfully or failed.
Vendors LinkedNumber of purchase orders that were connected to a supplier record.
Vendors CreatedNumber of new supplier records created for vendor names that did not match an existing supplier.

On the first import you may see a high Vendors Linked count as all vendor purchase orders get linked for the first time. On repeat imports this count reflects only newly imported purchase orders that needed linking. Vendors Created is zero when all vendor names already have a matching supplier.

Generate Supplier Cost Records

FieldMeaning
StatusWhether the step completed successfully or failed.
Total Inventory ItemsNumber of distinct inventory items found across all delivered purchase order line items.
Variants FoundHow many of those inventory items matched a product variant in Order Engine.
CreatedNew supplier cost records that were created.
UpdatedExisting supplier cost records that were refreshed with changed data.
UnchangedSupplier cost records that already had the correct values — nothing was written.
Skipped No VariantInventory items that exist in Stocky but do not have a matching product variant in Order Engine. This typically means the product has not yet been synced to Order Engine. Re-running the import after syncing those products will pick them up.
ErrorsNumber of individual inventory items that encountered a processing error. This should normally be zero.

Variants Found + Skipped No Variant should equal Total Inventory Items. A non-zero Skipped No Variant count is expected when Stocky contains products that have not been imported into Order Engine yet.

Error Handling

  • Step failure stops the import. If any step fails, the overall import is marked as failed and the remaining steps do not run.
  • Authorization errors. The most common failure is an invalid or expired Stocky API key. If this happens, verify that the API key configured for your source system is correct.
  • Automatic retries. Temporary network issues (connection resets, timeouts) are retried up to 3 times before the step is marked as failed.
  • Per-item errors in cost generation. If an individual inventory item fails during the cost-records step, it is logged and skipped, and processing continues. The Errors count in the results will reflect how many items were affected.

Frequently Asked Questions

Can I run the import more than once? Yes. The import is designed to be re-run safely. It will update any records that have changed and skip records that are already up to date.

Why are some inventory items skipped during cost generation? This happens when Stocky has products that have not yet been synced into Order Engine. Once those products are synced, re-running the import will generate cost records for them.

What happens if the import fails partway through? The steps that already completed are retained. You can re-run the full import and it will pick up where it left off, since each step uses upserts that do not create duplicates.

How long does the import take? This depends on the volume of data in Stocky. A typical import with around 1,000 purchase orders and 8,000 line items completes in under a minute.