Upload Farmer Registration Document for Trade
POST /api/v1/trades/{tradeId}/farmers-upload
Description
Submits a document for farmer registration within the context of a specific trade. This document typically contains details about the farmers participating in the trade, facilitating compliance and record-keeping requirements.
URL Parameters:
tradeId(required): The unique identifier of the trade for which the farmer registration document is being uploaded. This must be included in the URL path.
Headers:
tenantId(required): The tenant ID under which the document is being uploaded. This header identifies the specific tenant environment and should be included.userId(required): The user ID of the individual responsible for uploading the document. This header is used for authentication and authorization.countryCode(required): The country code where the trade is taking place. This should be included as a header.
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"
}
Example Request:
curl -X POST "http://[base_url]/api/v1/trades/{tradeId}/farmers-upload" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer [access_token]" \
-H "tenantId: TEN123" \
-H "userId: USR456" \
-H "countryCode: US" \
-d '{
"docLink": "http://example.com/path/to/farmers-doc.pdf",
"userId": "USR456",
"tenantId": "TEN123",
"countryCode": "US"
}'
Responses:
- 201 Created: Indicates that the farmer registration document has been successfully uploaded for the trade. The response typically includes confirmation of the upload.
Example Response:
{
"message": "Document uploaded successfully.",
"documentId": "doc123"
}
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}/farmers-upload \
--header 'accept: application/json' \
--header 'content-type: application/json'
RESPONSE
Click Try It! to start a request and see the response here!