Upload Multiple Farmer Batch Documents
POST /api/v1/trades/{tradeId}/farmer/batch/multiple/upload
Description
This endpoint facilitates the uploading of multiple batch documents related to farmers within a specific trade. It's used to provide documentation that verifies the details of various batches, such as quality checks, certification, or other relevant data necessary for compliance and tracking purposes across multiple farmers.
Headers:
countryCode(required): The country code where the trade is taking place. This should be included as a header.userId(required): The user ID of the individual responsible for uploading the documents.tenantId(required): The tenant ID under which the documents are being uploaded.
Request Body (application/json): Required. The body should include the document link and identifiers related to the user and tenant:
{
"docLink": "string",
"userId": "string",
"tenantId": "string",
"countryCode": "string"
}
Description: This endpoint facilitates the uploading of multiple batch documents related to farmers within a specific trade. It's used to provide documentation that verifies the details of various batches, such as quality checks, certification, or other relevant data necessary for compliance and tracking purposes across multiple farmers.
Example Request:
curl -X POST "http://[base_url]/api/v1/trades/{tradeId}/farmer/batch/multiple/upload" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer [access_token]" \
-H "countryCode: US" \
-H "userId: USR123" \
-H "tenantId: TEN123" \
-d '{
"docLink": "http://example.com/path/to/multiple/documents.pdf",
"userId": "USR123",
"tenantId": "TEN123",
"countryCode": "US"
}'
Responses:
- 201 Created: Indicates that the documents have been successfully uploaded for the batches. The response typically includes confirmation that the documents have been recorded and references to the uploaded documents.
Example Response:
{
"message": "Documents uploaded successfully.",
"documentIds": ["doc123", "doc124", "doc125"]
}
Error Responses:
- 400 Bad Request: Incorrect or incomplete data for the document upload.
- 404 Not Found: No trade found with the provided
tradeId. - 403 Forbidden: The user does not have permission to upload documents for the trade.
LANGUAGE
CURL REQUEST
curl --request POST \
--url /api/v1/trades/{tradeId}/farmer/batch/multiple/upload \
--header 'accept: application/json' \
--header 'content-type: application/json'
RESPONSE
Click Try It! to start a request and see the response here!