Update Return Shipment
PUT/api/vendor-credits/:vendor_credit/shipments/:vendor_credit_shipment
Update an existing return (RTV) shipment. Reverses the prior movements/allocations, then re-posts them from the new lines. For each restock product line, posts the outbound inventory movement (negative adjustment) and transitions the matching planned allocation to fulfilled.
Authentication: Requires Bearer token (PAT).
Body fields:
warehouse_id(required, integer) — warehouse the goods ship out of.shipment_date(required, date).status(optional, one of: pending, shipped, delivered, cancelled — defaults to shipped).tracking_number(optional, string, max 191).shipping_method_id(optional, integer — exists in shipping_methods).custom_carrier(optional, string, max 191).expected_arrival_date(optional, date).vendor_rma_number(optional, string, max 191).notes(optional, string).lines(required, array, min 1) — each line:vendor_credit_line_id(required, integer — exists in vendor_credit_lines).quantity(required, integer, min 1).warehouse_location_id(optional, integer — exists in warehouse_locations).notes(optional, string).lot_allocation(optional, array) — FEFO override for lot-tracked products. When supplied, the named FIFO layers are consumed instead of automatic FEFO. Each entry:{ fifo_layer_id (required, exists in fifo_layers), quantity (required, > 0) }. The allocation must sum to the line quantity, every layer must be an active layer of the line's product + the shipment warehouse with enough available quantity, and the tenant's lot override policy is enforced (underenforce, consuming expired stock or skipping the earliest-expiry FEFO lot is rejected with 422). Omit to consume by automatic FEFO/FIFO.
accounting:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Request
Responses
- 200
- 401
- 403
- 404
- 422
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
Validation failed — the body is a field → messages map (Laravel shape) or the platform envelope with a stable machine-readable code. Fix the payload and resubmit.
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.