Market 2.0 API
OpenAPI spec of Market 2.0 API.
These APIs can change without any notice as they are still being developed. This page is meant to be a reference for client libraries and SDK to allow parallel development.
List of supported DDO contracts
id
the status response for deal products with their respective deal statuses
Bad Request - Invalid input or validation error
Internal Server Error
GET /status/{id} HTTP/1.1
Host:
Accept: */*
{
"ddo_v1": {
"error_msg": "text",
"status": "accepted"
},
"pdp_v1": {
"error_msg": "text",
"status": "accepted"
}
}Make a mk20 deal
Client wallet for the deal
Data represents the source of piece data and associated metadata.
Identifier represents a unique identifier for the deal in UUID format.
Products represents a collection of product-specific information associated with a deal
Ok represents a successful operation with an HTTP status code of 200
Bad Request - Invalid input or validation error
ErrDealNotFound indicates that the specified deal could not be found, corresponding to the HTTP status code 404
ErrUnsupportedDataSource indicates the specified data source is not supported or disabled for use in the current context
ErrUnsupportedProduct indicates that the requested product is not supported by the provider
ErrProductNotEnabled indicates that the requested product is not enabled on the provider
ErrProductValidationFailed indicates a failure during product-specific validation due to invalid or missing data
ErrDealRejectedByMarket indicates that a proposed deal was rejected by the market for not meeting its acceptance criteria or rules
ErrServiceOverloaded indicates that the service is overloaded and cannot process the request at the moment
ErrMalformedDataSource indicates that the provided data source is incorrectly formatted or contains invalid data
ErrMarketNotEnabled indicates that the market is not enabled for the requested operation
ErrDurationTooShort indicates that the provided duration value does not meet the minimum required threshold
ErrServerInternalError indicates an internal server error with a corresponding error code of 500
ErrServiceMaintenance indicates that the service is temporarily unavailable due to maintenance, corresponding to HTTP status code 503
POST /store HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 813
{
"client": {},
"data": {
"format": {
"aggregate": "[Circular Reference]",
"car": {},
"raw": {}
},
"piece_cid": {},
"source_aggregate": {
"pieces": [
"[Circular Reference]"
]
},
"source_http": {
"urls": [
{
"fallback": true,
"headers": {
"ANY_ADDITIONAL_PROPERTY": [
"text"
]
},
"priority": 1,
"url": "text"
}
]
},
"source_httpput": {},
"source_offline": {}
},
"identifier": [
1
],
"products": {
"ddo_v1": {
"allocation_id": 0,
"contract_address": "text",
"contract_verify_method": "text",
"contract_verify_method_params": [
1
],
"duration": 1,
"notification_address": "text",
"notification_payload": [
1
],
"piece_manager": {},
"provider": {}
},
"pdp_v1": {
"add_root": true,
"create_proof_set": true,
"delete_proof_set": true,
"delete_root": true,
"extra_data": [
1
],
"proof_set_id": 1,
"record_keeper": "text",
"root_ids": [
1
]
},
"retrieval_v1": {
"announce_payload": true,
"announce_piece": true,
"indexing": true
}
}
}200Useful for adding adding additional products and updating PoRep duration
id
Client wallet for the deal
Data represents the source of piece data and associated metadata.
Identifier represents a unique identifier for the deal in UUID format.
Products represents a collection of product-specific information associated with a deal
Ok represents a successful operation with an HTTP status code of 200
Bad Request - Invalid input or validation error
ErrDealNotFound indicates that the specified deal could not be found, corresponding to the HTTP status code 404
ErrUnsupportedDataSource indicates the specified data source is not supported or disabled for use in the current context
ErrUnsupportedProduct indicates that the requested product is not supported by the provider
ErrProductNotEnabled indicates that the requested product is not enabled on the provider
ErrProductValidationFailed indicates a failure during product-specific validation due to invalid or missing data
ErrDealRejectedByMarket indicates that a proposed deal was rejected by the market for not meeting its acceptance criteria or rules
ErrServiceOverloaded indicates that the service is overloaded and cannot process the request at the moment
ErrMalformedDataSource indicates that the provided data source is incorrectly formatted or contains invalid data
ErrMarketNotEnabled indicates that the market is not enabled for the requested operation
ErrDurationTooShort indicates that the provided duration value does not meet the minimum required threshold
ErrServerInternalError indicates an internal server error with a corresponding error code of 500
ErrServiceMaintenance indicates that the service is temporarily unavailable due to maintenance, corresponding to HTTP status code 503
GET /update/{id} HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 813
{
"client": {},
"data": {
"format": {
"aggregate": "[Circular Reference]",
"car": {},
"raw": {}
},
"piece_cid": {},
"source_aggregate": {
"pieces": [
"[Circular Reference]"
]
},
"source_http": {
"urls": [
{
"fallback": true,
"headers": {
"ANY_ADDITIONAL_PROPERTY": [
"text"
]
},
"priority": 1,
"url": "text"
}
]
},
"source_httpput": {},
"source_offline": {}
},
"identifier": [
1
],
"products": {
"ddo_v1": {
"allocation_id": 0,
"contract_address": "text",
"contract_verify_method": "text",
"contract_verify_method_params": [
1
],
"duration": 1,
"notification_address": "text",
"notification_payload": [
1
],
"piece_manager": {},
"provider": {}
},
"pdp_v1": {
"add_root": true,
"create_proof_set": true,
"delete_proof_set": true,
"delete_root": true,
"extra_data": [
1
],
"proof_set_id": 1,
"record_keeper": "text",
"root_ids": [
1
]
},
"retrieval_v1": {
"announce_payload": true,
"announce_piece": true,
"indexing": true
}
}
}200Finalizes the serial upload process once data has been uploaded
id
Client wallet for the deal
Data represents the source of piece data and associated metadata.
Identifier represents a unique identifier for the deal in UUID format.
Products represents a collection of product-specific information associated with a deal
Ok represents a successful operation with an HTTP status code of 200
Bad Request - Invalid input or validation error
ErrDealNotFound indicates that the specified deal could not be found, corresponding to the HTTP status code 404
ErrUnsupportedDataSource indicates the specified data source is not supported or disabled for use in the current context
ErrUnsupportedProduct indicates that the requested product is not supported by the provider
ErrProductNotEnabled indicates that the requested product is not enabled on the provider
ErrProductValidationFailed indicates a failure during product-specific validation due to invalid or missing data
ErrDealRejectedByMarket indicates that a proposed deal was rejected by the market for not meeting its acceptance criteria or rules
ErrServiceOverloaded indicates that the service is overloaded and cannot process the request at the moment
ErrMalformedDataSource indicates that the provided data source is incorrectly formatted or contains invalid data
ErrMarketNotEnabled indicates that the market is not enabled for the requested operation
ErrDurationTooShort indicates that the provided duration value does not meet the minimum required threshold
ErrServerInternalError indicates an internal server error with a corresponding error code of 500
ErrServiceMaintenance indicates that the service is temporarily unavailable due to maintenance, corresponding to HTTP status code 503
POST /upload/{id} HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 813
{
"client": {},
"data": {
"format": {
"aggregate": "[Circular Reference]",
"car": {},
"raw": {}
},
"piece_cid": {},
"source_aggregate": {
"pieces": [
"[Circular Reference]"
]
},
"source_http": {
"urls": [
{
"fallback": true,
"headers": {
"ANY_ADDITIONAL_PROPERTY": [
"text"
]
},
"priority": 1,
"url": "text"
}
]
},
"source_httpput": {},
"source_offline": {}
},
"identifier": [
1
],
"products": {
"ddo_v1": {
"allocation_id": 0,
"contract_address": "text",
"contract_verify_method": "text",
"contract_verify_method_params": [
1
],
"duration": 1,
"notification_address": "text",
"notification_payload": [
1
],
"piece_manager": {},
"provider": {}
},
"pdp_v1": {
"add_root": true,
"create_proof_set": true,
"delete_proof_set": true,
"delete_root": true,
"extra_data": [
1
],
"proof_set_id": 1,
"record_keeper": "text",
"root_ids": [
1
]
},
"retrieval_v1": {
"announce_payload": true,
"announce_piece": true,
"indexing": true
}
}
}200Allows uploading data for deals in a single stream. Suitable for small deals.
id
UploadOk indicates a successful upload operation, represented by the HTTP status code 200
Bad Request - Invalid input or validation error
UploadStartCodeDealNotFound represents a 404 status indicating the deal was not found during the upload start process
UploadServerError indicates a server-side error occurred during the upload process, represented by the HTTP status code 500
PUT /upload/{id} HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 3
[
1
]200Finalizes the upload process once all the chunks are uploaded.
id
Client wallet for the deal
Data represents the source of piece data and associated metadata.
Identifier represents a unique identifier for the deal in UUID format.
Products represents a collection of product-specific information associated with a deal
Ok represents a successful operation with an HTTP status code of 200
Bad Request - Invalid input or validation error
ErrDealNotFound indicates that the specified deal could not be found, corresponding to the HTTP status code 404
ErrUnsupportedDataSource indicates the specified data source is not supported or disabled for use in the current context
ErrUnsupportedProduct indicates that the requested product is not supported by the provider
ErrProductNotEnabled indicates that the requested product is not enabled on the provider
ErrProductValidationFailed indicates a failure during product-specific validation due to invalid or missing data
ErrDealRejectedByMarket indicates that a proposed deal was rejected by the market for not meeting its acceptance criteria or rules
ErrServiceOverloaded indicates that the service is overloaded and cannot process the request at the moment
ErrMalformedDataSource indicates that the provided data source is incorrectly formatted or contains invalid data
ErrMarketNotEnabled indicates that the market is not enabled for the requested operation
ErrDurationTooShort indicates that the provided duration value does not meet the minimum required threshold
ErrServerInternalError indicates an internal server error with a corresponding error code of 500
ErrServiceMaintenance indicates that the service is temporarily unavailable due to maintenance, corresponding to HTTP status code 503
POST /uploads/finalize/{id} HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 813
{
"client": {},
"data": {
"format": {
"aggregate": "[Circular Reference]",
"car": {},
"raw": {}
},
"piece_cid": {},
"source_aggregate": {
"pieces": [
"[Circular Reference]"
]
},
"source_http": {
"urls": [
{
"fallback": true,
"headers": {
"ANY_ADDITIONAL_PROPERTY": [
"text"
]
},
"priority": 1,
"url": "text"
}
]
},
"source_httpput": {},
"source_offline": {}
},
"identifier": [
1
],
"products": {
"ddo_v1": {
"allocation_id": 0,
"contract_address": "text",
"contract_verify_method": "text",
"contract_verify_method_params": [
1
],
"duration": 1,
"notification_address": "text",
"notification_payload": [
1
],
"piece_manager": {},
"provider": {}
},
"pdp_v1": {
"add_root": true,
"create_proof_set": true,
"delete_proof_set": true,
"delete_root": true,
"extra_data": [
1
],
"proof_set_id": 1,
"record_keeper": "text",
"root_ids": [
1
]
},
"retrieval_v1": {
"announce_payload": true,
"announce_piece": true,
"indexing": true
}
}
}200Return a json struct detailing the current status of a deal upload.
id
The status of a file upload process, including progress and missing chunks
Bad Request - Invalid input or validation error
UploadStatusCodeDealNotFound indicates that the requested deal was not found, corresponding to status code 404
UploadStatusCodeUploadNotStarted indicates that the upload process has not started yet
UploadStatusCodeServerError indicates an internal server error occurred during the upload process, corresponding to status code 500
GET /uploads/{id} HTTP/1.1
Host:
Accept: */*
{
"missing": 1,
"missing_chunks": [
1
],
"total_chunks": 1,
"uploaded": 1,
"uploaded_chunks": [
1
]
}Initializes the upload for a deal. Each upload must be initialized before chunks can be uploaded for a deal.
id
ChunkSize defines the size of each data chunk to be used during the upload process.
RawSize indicates the total size of the data to be uploaded in bytes.
UploadStartCodeOk indicates a successful upload start request with status code 200
Bad Request - Invalid input or validation error
UploadStartCodeDealNotFound represents a 404 status indicating the deal was not found during the upload start process
UploadStartCodeAlreadyStarted indicates that the upload process has already been initiated and cannot be started again
UploadStartCodeServerError indicates an error occurred on the server while processing an upload start request
POST /uploads/{id} HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 29
{
"chunk_size": 1,
"raw_size": 1
}200Allows uploading chunks for a deal file. Method can be called in parallel to speed up uploads.
id
chunkNum
UploadOk indicates a successful upload operation, represented by the HTTP status code 200
Bad Request - Invalid input or validation error
UploadNotFound represents an error where the requested upload chunk could not be found, typically corresponding to HTTP status 404
UploadChunkAlreadyUploaded indicates that the chunk has already been uploaded and cannot be re-uploaded
UploadServerError indicates a server-side error occurred during the upload process, represented by the HTTP status code 500
PUT /uploads/{id}/{chunkNum} HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 3
[
1
]200Last updated