Deal Processing
This page defines the deal intake paths, lifecycle progression, status semantics, and pipeline behavior for Market 2.0.
Deal Intake Paths
All intake paths use the same deal model and the same deal identifier (id, ULID). They differ only in when and how piece bytes are provided.
1. Provider-Pull Deal
Use this path when the storage provider should fetch data from client-supplied sources.
API sequence:
POST /dealGET /status/{id}until terminal state
No upload endpoints are used.
2. Accept-Then-Upload Deal
Use this path when a client wants acceptance first, then uploads bytes.
API sequence:
POST /dealUpload bytes using one mode:
Serial:
PUT /upload/{id}thenPOST /upload/{id}Chunked:
POST /uploads/{id}thenPUT /uploads/{id}/{chunkNum}(repeat) thenPOST /uploads/finalize/{id}GET /status/{id}until terminal state
3. Upload-First-Then-Describe Deal
Use this path when bytes are uploaded first and full deal details are supplied at finalize. This requires an initial product flow that can be accepted without data details. DDO deals require data during initial acceptance, so DDO upload flows should use source_http_put in the initial deal instead.
API sequence:
POST /dealUpload bytes using one mode:
Serial:
PUT /upload/{id}Chunked:
POST /uploads/{id}thenPUT /uploads/{id}/{chunkNum}(repeat)Finalize with full deal payload:
Serial:
POST /upload/{id}Chunked:
POST /uploads/finalize/{id}GET /status/{id}until terminal state
Current behavior: this path is supported in both serial and chunked finalize flows for products that can enter upload-waiting without initial data details.
4. Control-Only Operation (No Piece Ingestion)
Use this path for PDP lifecycle operations that do not ingest piece data (for example dataset create, dataset delete, or piece-remove operations).
API sequence:
POST /dealGET /status/{id}until terminal state
No upload endpoints are used.
Deal Lifecycle
Once accepted, deals follow a common lifecycle model:
accepted: proposal admitted.uploading(optional): waiting for or receiving client-uploaded bytes.processing: product execution has started.sealing(when applicable): sealing work in progress.indexing(when applicable): indexing and retrieval preparation in progress.Terminal outcome:
completeorfailed.
Not every deal uses every intermediate state. Upload-less operations typically skip uploading.
Status Checks
Use GET /status/{id} for lifecycle tracking.
Status is returned per product present in the deal.
Status values:
accepteduploadingprocessingsealingindexingcomplete(terminal success)failed(terminal failure)
Use upload endpoints for byte-transfer progress (/upload*, /uploads*). Use /status/{id} for lifecycle state.
Pipelines
Pipelines are the asynchronous execution layer behind lifecycle transitions.
What pipelines do:
Run ingest work for pull and upload flows.
Run product-specific execution once data is ready.
Advance deals to terminal outcome.
When pipeline execution starts:
Pull-based deals: after acceptance.
Upload-based deals: after upload finalize.
Control-only operations: after acceptance.
Operational guidance:
If an upload-based deal appears stalled, verify finalize was called.
If status remains non-terminal unexpectedly, provider-side operational inspection is required.
Last updated