Skip to main content

Sales Channels

📄️Remove Single Discard

Remove a single discard record. The parent shipment's `qty_discarded` counter is decremented by the deleted row's quantity (backward-compat column kept in sync with the new `amazon_fba_removal_shipment_discards` audit table). Returns 404 if the discard does not belong to the supplied integration instance. After deletion, the removal order's receipt_status is recomputed (e.g. an order that was `fully_discarded` may transition back to `pending` if there are no other discards or receipts).

📄️List AWD Ledgers (per integration instance)

List AWD (Amazon Warehousing and Distribution) ledger entries for the given Amazon integration instance. This endpoint uses the generic DataTable trait which paginates and exposes column-level visibility via included/excluded JSON arrays. The route automatically scopes results to integration_instance_id = {integrationInstance}. The AmazonAwdLedger model does not use HasFilters/HasSort traits, so it does not accept Spatie-style filter[xxx] / sort=... query params beyond DataTable's standard mechanics.

📄️List FBA Shipments Detail (paginated, across instances)

Paginated list of FBA shipments-detail rows aggregated across Amazon integration instances. Each row represents one shipped item line from the GET_AMAZON_FULFILLED_SHIPMENTS_DATA_GENERAL report. Filtering uses Spatie QueryBuilder with AdvancedSearchFilter (search across order/shipment/product/tracking/recipient fields) plus ~25 text filters, ~9 numeric filters, and ~8 datetime filters. Response includes linked_sales_order (bulk-resolved via amazon_order_id → amazon_orders → sales_orders join) and amazon_product (bulk-resolved by integration_instance_id + seller_sku). Default sort: -shipment_date.

📄️List Shipments

Returns a paginated `LengthAwarePaginator` of new (v2) FBA inbound shipments across one or more Amazon integration instances. Each item is transformed by `AmazonNewFbaInboundShipmentResource` and includes identifier fields (`shipmentId`, `shipmentConfirmationId`, `amazonReferenceId`, `name`, `sourceName`), status info (`status`, `pending_status`, `errorLog`, `is_archived`), destination block (`destinationCountry`, `destinationWarehouse`, `destinationType`, `destination`), transportation IDs, the `sku_link` block (linked Purchase Order or Warehouse Transfer), `actual_source` (resolved supplier/from-warehouse derived from the SKU link), and `ship_from_mapping` (the mapping that *would* be applied today — used to surface divergence client-side). When the relevant relations are eager-loaded the resource also returns `pending_inbound`, `receipts`, and `items`. Defaults to excluding archived shipments unless `filter[archived]` is provided.

📄️List Orders

Spatie QueryBuilder paginated list of TikTok Shop orders across instances. Allowed filters: integration_instance_ids, status (TikTok Shop single-axis enum: UNPAID|ON_HOLD|AWAITING_SHIPMENT|PARTIALLY_SHIPPING|AWAITING_COLLECTION|IN_TRANSIT|DELIVERED|COMPLETED|CANCELLED), fulfillment_method, currency, payment_method_name, cancelled, archived, status_state (active|archived|all), search (matches tiktok_order_id/buyer_email/recipient_name), date_from, date_to. Allowed sorts: id, tiktok_order_id, status, total_amount, tiktok_create_time, tiktok_update_time, tiktok_paid_time, last_sync_at, created_at, updated_at. Default sort: -tiktok_create_time. per_page defaults to 10.