Imports line items into the specified cart from a CSV file, supporting both create and update
in a single request. Rows with a non-empty Id column are treated as updates to existing line items.
Rows without an Id (or with an empty Id) are treated as new items and require ProductCode or Product.Id
(except Miscellaneous lines where LineType=Misc is sufficient without product identification).
CSV Requirements
-
Maximum 5000 data rows allowed (excluding header).
-
Maximum file size: 100 MB.
-
First row must be a valid header.
-
Rows with Id are treated as updates to existing line items.
-
Rows without Id are treated as new line items (must have ProductCode or Product.Id, OR LineType=Misc).
-
Column names are case-insensitive (e.g., "productcode" and "ProductCode" are equivalent).
-
Dot-notation supported (e.g., Product.Id, CustomProperties.MyField) and expanded into nested JSON.
CREATE PAYLOAD (rows WITHOUT Id)
Mandatory fields:
-
ProductCode OR Product.Id: at least one required (except for Misc lines).
-
LineType: mandatory when creating Misc lines (value: "Misc").
Auto-assigned fields:
-
PrimaryTxnLineNumber: unique per item, auto-incremented or remapped to avoid conflicts.
-
LineType: auto-set to "Product/Service" or "Option" (unless explicitly "Misc").
-
PricingStatus: always set to "Pending".
Optional fields:
- Quantity, SellingTerm, StartDate, EndDate, Comments, Description, IsPrimaryLine, TxnParentBundleNumber, CustomProperties.*, etc.
Filtered rows:
- Rows with IsPrimaryLine=false are silently removed (secondary charge lines not created via import).
Bundle/Option rules:
-
PrimaryTxnLineNumber must be unique across all create rows.
-
Options must reference a valid parent via TxnParentBundleNumber.
-
An Option without valid numeric TxnParentBundleNumber throws a validation error.
UPDATE PAYLOAD (rows WITH Id)
Mandatory field:
- Id: existing line item identifier (GUID).
Updatable fields:
- Any LineItem property: Quantity, SellingTerm, StartDate, EndDate, Comments, Description, Name, CustomProperties.*, AdjustmentType, PriceAdjustmentAmount, NetPrice, etc.
Additional rules:
-
ProductCode column is stripped after parsing (not needed for updates since the product is already associated).
-
Duplicate rows with the same Id are deduplicated (last wins).
MISC LINE PAYLOAD (LineType = "Misc")
Misc lines represent non-product charges (e.g., sales tax, fees, adjustments). They do NOT require ProductCode or Product.Id.
Mandatory fields:
-
LineType: must be "Misc" (case-insensitive).
-
IsPrimaryLine: must be true.
-
BasePrice: required by downstream validation.
-
Name: required by downstream validation.
-
ChargeType: required by downstream validation.
Optional fields:
- AdjustmentType, AdjustmentAmount, Quantity, PrimaryTxnLineNumber, PricingStatus.
Behavior:
-
Product resolution is skipped entirely; no DB lookup or GUID validation.
-
LineType "Misc" is preserved as-is (not overwritten to Product/Service).
-
PricingStatus is set to "Pending" regardless of input value.
Processing Order
-
Create path runs first. If it fails (validation, product resolution), the update is NOT attempted.
-
Update path runs second. If it fails, an error is thrown (create already committed).
-
On full success, an ImportUpsertResponse with both counts is returned.
Required Fields:
cartId(route) - requiredfile(form) - required; must be a .csv file, max 100 MB
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
202Import processed successfully and line items were created or updated.
500An unexpected server error occurred during processing.
