Write readiness
Review supported writes with non-mutating dryRun checks. Price Entry management requires a complete approved review before applying changes.
The API supports dryRun=true on Chart of Accounts, Shipping Options, tags and tag assignments, representatives, payment terms, notes, contacts, customer, supplier, warehouse, reorder-point, parent-scoped child location/address, archive and restore, attached document, product, product-family, Product SDS, Cost Book, Current Source, and Price Book write endpoints. A dry run checks the exact intended request without creating or updating records.
Attribute vocabulary management and reordering, certification-type setup, certificate filing, renewal and deletion, lot COA assignment, and supplier carrier profiles also support dryRun=true. Use the same intended request and the endpoint's current-record timestamp or COA version when required.
Most supported writes allow direct execution when the integration's policy permits it. Price Entry management requires a dryRun=true review and its returned review values before execution. This is a review of the exact request, not a requirement for a person to approve it in ShelfCycle.
Supported endpoints
Task writes support preview. Send the stable Idempotency-Key for create and the current task updatedAt as If-Match for edits. Complete and reopen need neither header. See Tasks.
POST /order-history/batch?dryRun=true previews read-only commercial history additions and corrections from before the organization's GL start date. Review each item's before and after values, changes, and totals. Updates send expectedUpdatedAt in each document, and execution requires Idempotency-Key. The preview returns no plan token. See Order history.
POST /warehouse-locations/batch?dryRun=true previews 1–50 locations independently, without an Idempotency-Key or saved results. Ready items include data.resultAction as created or unchanged. Each preview is separate: a new parent from an earlier item is not available to a child preview; verify parents first. Execution requires a stable key, Warehouse write access, and current location create permission, plus archive permission when any item requests archived: true. This batch adds no /me write-readiness operation. See Warehouses.
Product and work-order batches preview each item independently as ready or failed, with no records or retry results saved and no required Idempotency-Key. Execution requires a stable key. Product batches use products:write and Product create permission; work-order batches need work-orders:write, Work Order create and update, and Work Orders enabled. See Product setup and Work-order imports.
COA import on POST /coas and POST /lots/{id}/coas saves the file by default. Send skipAi: false to request background reading. Preview is available for the current-file COA PUT. The import POSTs create a certificate on each accepted call. See Lots for upload and retry guidance.
Tax setup supports preview on every catalog, period, archive, and ship-to assignment write. Type/rate/period creates need a stable Idempotency-Key to be ready. PATCH/archive use the matching record's current If-Match, and period DELETE uses the period's timestamp. Assignment PUT needs neither header; assignment batches preview each item independently as ready or failed. Formula and Repack previews also validate optional costs and output-allocation positions, without starting work orders. See Tax setup and the template import guides for exact rules.
| Endpoint | Scope | Execution header |
|---|---|---|
PATCH or DELETE /price-book-entries/{id} | price-book-entries:write | Idempotency-Key and current If-Match on preview and execution; approved review on execution |
POST /price-book-entries/batch | price-book-entries:write | Approved review and Idempotency-Key for execution |
POST /products/batch | products:write | Idempotency-Key for execution; optional for preview |
POST /work-orders/batch | work-orders:write | Idempotency-Key for execution; optional for preview |
POST /repack-templates/batch | repack-templates:write | Idempotency-Key for execution; optional for preview |
POST /formulas/batch | formulas:write | Idempotency-Key for execution; optional for preview |
POST /certification-records | certifications:write; warehouse subjects also require Warehouse read and write access | None |
PATCH /certification-records/{recordId} | certifications:write; warehouse subjects also require Warehouse read and write access | If-Match using the record's updatedAt for a changed request |
DELETE /certification-records/{recordId} | certifications:write and current subject edit access | If-Match using the record's current updatedAt |
POST /certification-types; type PATCH or DELETE; date policy PUT /certification-types/{typeId}/validity-date-policy | certification-types:write | Create uses Idempotency-Key; PATCH, DELETE, and date policy PUT use type updatedAt in If-Match |
| Code and family attribute definitions and values | product-attributes:write and Product update permission | Create uses Idempotency-Key; PATCH and DELETE use current updatedAt in If-Match; reorder uses complete orderedIds |
PUT /lots/{id}/coa | lots:write | If-Match using the returned COA version for replacement; omit on first assignment |
POST /reference/ledger-accounts | company-reference:write | Idempotency-Key when externalId is absent |
PATCH /reference/ledger-accounts/{id} | company-reference:write | If-Match |
POST /shipping-options | shipping-options:write | Idempotency-Key for a new option |
PATCH /shipping-options/{id}, POST /shipping-options/{id}/archive, or /unarchive | shipping-options:write | If-Match |
POST /warehouses | warehouses:write | Idempotency-Key when externalId is absent |
PATCH /warehouses/{id}, POST /warehouses/{id}/archive, or /unarchive | warehouses:write | If-Match |
POST /reorder-points | reorder:write | None |
POST /tags, PATCH /tags/{id}, and POST or DELETE /tag-assignments | tags:write | None |
POST /representatives, representative PATCH, archive, or unarchive | company-reference:write | Idempotency-Key for create; If-Match for update, archive, or restore |
POST /payment-terms, PATCH /payment-terms/{id} | company-reference:write | Idempotency-Key for create; If-Match for update |
POST /notes | notes:write | Idempotency-Key |
PATCH /notes/{id} | notes:write | If-Match |
POST /contacts | contacts:create | Idempotency-Key |
PATCH /contacts/{id} | contacts:update | If-Match |
POST /contacts/{id}/archive or /unarchive | contacts:update | If-Match |
POST /customers, POST /suppliers | customers:write or suppliers:write | Idempotency-Key |
PATCH /customers/{id}, PATCH /suppliers/{id} | customers:write or suppliers:write | If-Match |
POST /customers/{id}/archive or /unarchive, POST /suppliers/{id}/archive or /unarchive | customers:write or suppliers:write | If-Match |
POST /customers/{id}/locations, POST /customers/{id}/locations/{locationId}/addresses | customers:write | Idempotency-Key |
PATCH /customers/{id}/locations/{locationId}, PATCH /customers/{id}/locations/{locationId}/addresses/{addressId} | customers:write | If-Match |
Customer-address archive or unarchive action | customers:write | If-Match |
POST /customers/{id}/documents | customers:write | Idempotency-Key |
POST /suppliers/{id}/ship-from-locations | suppliers:write | Idempotency-Key |
PATCH /suppliers/{id}/ship-from-locations/{locationId} | suppliers:write | If-Match |
Supplier ship-from archive or unarchive action | suppliers:write | If-Match |
POST /suppliers/{id}/documents | suppliers:write | Idempotency-Key |
POST /products | products:write | Idempotency-Key |
PATCH /products/{id} | products:write | If-Match |
POST /products/{id}/documents | products:write | Idempotency-Key |
POST /orders/{id}/documents | sales-order-documents:write | Idempotency-Key |
POST /bills/{id}/documents | bill-documents:write | Idempotency-Key |
PUT /products/{id}/sds | products:write | If-Match |
POST /product-families | products:write | Idempotency-Key |
PATCH /product-families/{id} | products:write | If-Match |
POST /cost-book-entries | cost-book-entries:write | Idempotency-Key |
PATCH /cost-book-entries/{id} | cost-book-entries:write | Idempotency-Key and If-Match from the entry's current updatedAt |
DELETE /cost-book-entries/{id} | cost-book-entries:write | Idempotency-Key |
POST /cost-book-entries/batch | cost-book-entries:write | Idempotency-Key |
PUT /products/{id}/current-cost-source | current-cost-sources:write | expectedCurrentSupplierId in the body |
POST /price-book-entries | price-book-entries:write | Idempotency-Key |
Dry runs use the same write scope, live user permission, and rate-limit family as execution. They do not introduce a separate permission model.
Request
See Attribute vocabulary for independent vocabulary and family-assignment previews, including complete collection membership for reorder. See Certification Intelligence for type setup, recipients, pending status, explicit null clearing, and record deletion. A preview does not save these changes; missing required keys or timestamps report blocked readiness.
Certification date policy previews use certification_types.put_validity_date_policy and the type's current updatedAt in If-Match. Requiring dates or supporting documents checks whether active records satisfy the proposed requirement. A blocked result includes active_cert_requirements and counts in impactAnalysis.missingValidityDates and missingDocumentation.
Sales-order and bill attachments use the same dryRun=true preview on their exact document route. Supply only fileName and url from a completed upload or external HTTPS link, with the matching document write scope and current record access. A missing Idempotency-Key is a blocked readiness check; include the same stable key for preview and execution. Operations are sales_order_documents.create and bill_documents.create. See Attached documents for URL rules, permissions, and verification.
For formula and Repack imports, GET /me exposes workOrderV2Eligible alongside the scope-and-permission create capability. Their writeReadiness.create values include Work Order availability; the request checks availability again even for a preview.
Send the same method, endpoint, headers, and body you plan to execute, with dryRun=true in the query string.
curl "$SHELFCYCLE_API_BASE_URL/contacts?dryRun=true" \
-X POST \
-H "Authorization: Bearer $SHELFCYCLE_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: gmail-thread-123:customer-id:create-contact:jane@example.com" \
-d '{
"parent": { "type": "customer", "id": "customer-id" },
"name": "Jane Buyer",
"title": "Purchasing",
"email": "jane@example.com",
"phone": "555-0100"
}'
dryRun must be exactly true. Invalid values such as dryRun=false, dryRun=1, or repeated dryRun parameters fail validation and must not be retried as execution.
Price Book uses a review-and-apply sequence. Its dry run returns expectedAffectedEntryIds and expectedPlanToken; include both in the later execution while keeping the same stable Idempotency-Key. See the Price Book guide for the complete request shape.
Current Source uses a read-preview-apply sequence. Read GET /products/{id}/current-cost-source, preview the desired supplierId and shipFromLocationId with the observed expectedCurrentSupplierId and expectedCurrentShipFromLocationId, then send the same PUT without dryRun=true. The preview returns the desired and previous source, consequence, eligibility, and a verification path. See the Cost Book guide for set, replace, and clear examples.
Cost Book updates, corrections, and batches use the same preview-and-apply pattern. Preview the exact POST or PATCH with dryRun=true, review every readiness check and predicted entry, then execute the identical request with the same stable Idempotency-Key. PATCH corrects the entry in place and uses its current updatedAt as If-Match; without a current timestamp, preview reports a stale_record check. Batch editCost items carry that timestamp in payload.expectedUpdatedAt. Batch preview validates the whole request and every item without saving results.
Formula imports use POST /formulas/batch?dryRun=true to return ordered ready or failed results without saving formulas. This preview does not require Idempotency-Key; execution does. Both require formulas:write, current Work Order update permission, and Work Orders enabled for the acting person. See Formula imports.
Archive and restore actions use a current-record preview-and-apply pattern. Preview the selected action without If-Match to receive impactAnalysis.currentUpdatedAt, review the target state and any customer or supplier safeguards, then execute with that timestamp in If-Match. See Archive and restore for the complete flow.
Shipping Options use the same preview-and-apply pattern. Create with a stable Idempotency-Key; update, archive, or restore with the selected option's latest updatedAt value in If-Match. See Shipping Options for complete examples.
Chart of Accounts uses the same pattern. Create with a stable Idempotency-Key when no source ID is available; update with the selected account's latest updatedAt value in If-Match. See Chart of Accounts for complete examples.
Create a separate source record
Customer, supplier, contact, combined customer-location, customer-address, and supplier ship-from creates accept optional top-level duplicateResolution: "create_distinct". Use it only when a reviewable similarity represents a separate legitimate source record. Without it, similarity candidates keep the write blocked for review.
The option does not change exact source-ID, archived-record, hidden-candidate, address-role, reference, or customer-location-name conflicts. Dry run is optional; execution checks the current records again.
Response
Most dry runs return HTTP 200 with data.type: "write_readiness" when the request can be evaluated. Current Source returns its focused status, consequence, eligibility, and verification fields. Use response data, not HTTP status alone, to decide what happened.
{
"data": {
"type": "write_readiness",
"operation": "contacts.create",
"status": "ready",
"wouldWrite": false,
"checks": [
{ "code": "scope_authorized", "status": "passed", "message": "The key can create contacts." },
{ "code": "parent_available", "status": "passed", "message": "The parent is visible and active." },
{ "code": "duplicate_check_clear", "status": "passed", "message": "No duplicate contact candidate was found." },
{ "code": "idempotency_available", "status": "passed", "message": "The idempotency key is available." }
],
"duplicateCandidates": [],
"idempotency": { "required": true, "keyProvided": true, "wouldReplay": false },
"submit": { "method": "POST", "path": "/api/v1/contacts", "query": {} },
"verification": {
"available": true,
"method": "GET",
"path": null,
"pathTemplate": "/api/v1/contacts/{id}",
"requiresScopes": ["contacts:read"],
"fallback": "detail_get"
},
"requestId": "request-id"
}
}
wouldWrite is always false for dry runs. A dry run must not create business rows, update updatedAt, create idempotency identities, write embeddings, acquire mutation locks, or trigger downstream side effects.
Ready and blocked
status: "ready" means the request passed the available checks at that moment. Execution confirms the request again against current ShelfCycle data.
status: "blocked" means the API found a condition your workflow must handle before execution. Common blocked checks include:
duplicate_candidate_found
duplicate_candidate_overflow
duplicate_reference_identity
idempotency_key_required
idempotency_key_reused
stale_record
target_not_found_or_not_visible
unsupported_profile_shape
unsupported_linked_record
not_api_created
primary_change_unsupported
address_role_required
product_family_reference_active
product_packaging_reference_active
supplier_reference_active
reference_visibility_blocked
payment_terms_reference_exists
sales_person_reference_active
customer_service_representative_reference_active
supplier_representative_reference_active
ledger_account_reference_valid
cost_ship_from_location_not_visible
cost_book_base_ambiguous
invalid_variable_qty
order_sensitive_update_blocked
validation_failed
archived_record
archive_blocked
duplicate_document
Duplicate candidates are advisory and bounded. If the key cannot read the matching detail route, the candidate can be redacted to readable: false with only type and matchReasons.
Execute and verify
To execute, remove dryRun=true and send the same request when your integration policy allows it.
Use each endpoint's documented execution headers. Many POST creates require Idempotency-Key; certificate filing instead recognizes identical saved dates and documents. Most PATCH endpoints and Product SDS execution require If-Match; certificate PATCH uses the record's updatedAt for a change, while lot COA replacement uses its returned version. Cost Book PATCH requires Idempotency-Key, expectedCurrentEntryId, and the entry's current updatedAt as If-Match. Current Source PUT requires the supplier and ship-from location observed before the change as expectedCurrentSupplierId and expectedCurrentShipFromLocationId. Execution can still return 409 if another write changes state after the dry run.
After execution, use verification.path when the response provides one and the key has the required scope. If verification is not available, use the execute response as readback. Price Book execution returns the complete saved entry and ready links.self and links.history paths.
A readiness response never grants extra access. Use the exact record-specific scope for an attachment or SDS assignment, and verify the result through the selected record's read route.