Skip to content

cURL

Quick reference for interacting with the N’entropy EUDR Integration API using cURL.

All requests require a Bearer token:

Terminal window
export EUDR_API_KEY="eudr_live_abc123..."
Terminal window
curl -X POST https://backend.joinnentropy.com/api/v1/integration/suppliers \
-H "Authorization: Bearer $EUDR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"suppliers": [
{
"externalId": "SUP-001",
"name": "Amazon Timber Co.",
"country": "BR",
"address": "123 Forest Road",
"city": "Manaus",
"email": "contact@amazontimber.co",
"taxId": "12.345.678/0001-90"
},
{
"externalId": "SUP-002",
"name": "Southeast Asia Palm Ltd.",
"country": "ID",
"address": "456 Palm Avenue",
"city": "Jakarta"
}
]
}'

Response:

{
"success": true,
"data": {
"created": 2,
"updated": 0,
"errors": []
}
}
Terminal window
curl https://backend.joinnentropy.com/api/v1/integration/suppliers \
-H "Authorization: Bearer $EUDR_API_KEY"

With pagination:

Terminal window
curl "https://backend.joinnentropy.com/api/v1/integration/suppliers?page=1&limit=25" \
-H "Authorization: Bearer $EUDR_API_KEY"
Terminal window
curl -X POST https://backend.joinnentropy.com/api/v1/integration/products \
-H "Authorization: Bearer $EUDR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"products": [
{
"externalId": "PROD-001",
"name": "Brazilian Eucalyptus Timber",
"hsCode": "4407.11",
"description": "Sustainably sourced eucalyptus planks",
"supplierExternalId": "SUP-001"
}
]
}'
Terminal window
curl "https://backend.joinnentropy.com/api/v1/integration/products?page=1&limit=50" \
-H "Authorization: Bearer $EUDR_API_KEY"
Terminal window
curl -X POST https://backend.joinnentropy.com/api/v1/integration/batches \
-H "Authorization: Bearer $EUDR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"batches": [
{
"externalId": "BATCH-2024-001",
"productExternalId": "PROD-001",
"quantity": 5000,
"unit": "kg",
"batchDate": "2024-06-15"
}
]
}'
Terminal window
curl "https://backend.joinnentropy.com/api/v1/integration/batches?page=1&limit=50" \
-H "Authorization: Bearer $EUDR_API_KEY"
Terminal window
curl https://backend.joinnentropy.com/api/v1/integration/sync-status \
-H "Authorization: Bearer $EUDR_API_KEY"
Terminal window
curl "https://backend.joinnentropy.com/api/v1/integration/sync-status?entityType=SUPPLIER&page=1&limit=50" \
-H "Authorization: Bearer $EUDR_API_KEY"
Terminal window
curl https://backend.joinnentropy.com/api/v1/integration/dds/BATCH-2024-001 \
-H "Authorization: Bearer $EUDR_API_KEY"

Response:

{
"success": true,
"data": {
"batch": {
"externalId": "BATCH-2024-001",
"quantity": 5000,
"syncStatus": "synced"
},
"product": {
"name": "Brazilian Eucalyptus Timber",
"hsCode": "4407.11"
},
"supplier": {
"name": "Amazon Timber Co.",
"country": "BR"
},
"ddsSubmissions": [
{
"status": "submitted",
"submittedAt": "2024-06-16T12:00:00Z"
}
]
}
}
Terminal window
curl https://backend.joinnentropy.com/api/v1/integration/field-mappings \
-H "Authorization: Bearer $EUDR_API_KEY"
Terminal window
curl -X POST https://backend.joinnentropy.com/api/v1/integration/webhook-events \
-H "Authorization: Bearer $EUDR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"event": "sync.completed",
"data": {
"entityType": "SUPPLIER",
"recordsAffected": 15
}
}'
#!/bin/bash
# sync-suppliers.sh — Read suppliers from CSV and sync
API_KEY="eudr_live_abc123..."
# Build JSON from CSV (skip header)
SUPPLIERS=$(tail -n +2 suppliers.csv | awk -F',' '{
printf "{\"externalId\":\"%s\",\"name\":\"%s\",\"country\":\"%s\",\"email\":\"%s\"},", $1, $2, $3, $4
}' | sed 's/,$//')
curl -X POST https://backend.joinnentropy.com/api/v1/integration/suppliers \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d "{\"suppliers\":[$SUPPLIERS]}"
#!/bin/bash
# Sync all suppliers, 100 at a time
API_KEY="eudr_live_abc123..."
PAGE=1
while true; do
RESPONSE=$(curl -s "https://backend.joinnentropy.com/api/v1/integration/suppliers?page=$PAGE&limit=100" \
-H "Authorization: Bearer $API_KEY")
COUNT=$(echo "$RESPONSE" | jq '.data.records | length')
echo "Page $PAGE: $COUNT suppliers"
if [ "$COUNT" -lt 100 ]; then
break
fi
PAGE=$((PAGE + 1))
done
#!/bin/bash
# Quick connectivity test
API_KEY="eudr_live_abc123..."
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" \
https://backend.joinnentropy.com/api/v1/integration/sync-status \
-H "Authorization: Bearer $API_KEY")
if [ "$HTTP_CODE" -eq 200 ]; then
echo "✓ API connection OK"
else
echo "✗ API returned $HTTP_CODE"
exit 1
fi
{
"success": false,
"error": {
"code": "INVALID_TOKEN",
"message": "The provided API token is invalid"
}
}
{
"success": false,
"error": {
"code": "INSUFFICIENT_SCOPES",
"message": "Token missing required scopes: suppliers:write"
}
}
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Each supplier must have externalId and name"
}
}
Terminal window
# Handle rate limiting with exponential backoff
for i in 1 2 3; do
RESPONSE=$(curl -s -w "\n%{http_code}" -X POST ... )
HTTP_CODE=$(echo "$RESPONSE" | tail -1)
if [ "$HTTP_CODE" -eq 429 ]; then
WAIT=$((2 ** i))
echo "Rate limited, waiting ${WAIT}s..."
sleep $WAIT
else
echo "$RESPONSE" | head -1
break
fi
done