Supplier Onboarding

End-to-end example — register a supplier, attach its GOTS certification, and mark it REACH compliant.

This recipe walks through onboarding a new supplier:

  1. Create the supplier record.
  2. Attach one or more certifications.
  3. Update compliance flags after document verification.

1. Create the supplier

Shell
curl -X POST {{BASE_URL}}/api/v1/suppliers \
-H "Content-Type: application/json" \
-d '{
"name": "Acme Textiles Ltd",
"category": "TEXTILES",
"vatNumber": "IT01234567890",
"country": "IT",
"city": "Milano",
"contactEmail": "mario@acme.it",
"activityType": "Dyeing",
"metadata": { "erpCode": "SUP-042" }
}'

Capture the returned id — you'll need it for the next calls.

2. Attach a GOTS certification

Shell
SUPPLIER_ID="3f2b9a1c-…"
curl -X POST "{{BASE_URL}}/api/v1/supplier-certifications?supplierId=$SUPPLIER_ID" \
-H "Content-Type: application/json" \
-d '{
"supplierId": "'"$SUPPLIER_ID"'",
"certificationType": "GOTS",
"certificateNumber": "GOTS-2026-0001",
"certificateExpiry": "2027-04-21T00:00:00.000Z",
"isDigitallySigned": true,
"verificationStatus": "PENDING"
}'

Repeat the call for every certificate the supplier holds (OEKO-TEX, GRS, ISO 14001, REACH, …).

3. List certifications for the supplier

Shell
curl "{{BASE_URL}}/api/v1/supplier-certifications?supplierId=$SUPPLIER_ID"

4. Mark the certification verified after review

Shell
CERT_ID="6d1b2e0a-…"
curl -X PATCH "{{BASE_URL}}/api/v1/supplier-certifications/$CERT_ID" \
-H "Content-Type: application/json" \
-d '{
"verificationStatus": "VERIFIED",
"signatureVerified": true,
"verificationDetails": "Digital signature chain validated"
}'

5. Flag the supplier as REACH compliant

Shell
curl -X PATCH "{{BASE_URL}}/api/v1/suppliers/$SUPPLIER_ID" \
-H "Content-Type: application/json" \
-d '{ "reachCompliant": true, "svhcCompliant": true }'

6. Verify everything in a single call

Shell
curl "{{BASE_URL}}/api/v1/suppliers/$SUPPLIER_ID"

The response includes the supplier and its embedded certifications[] array — perfect for rendering an onboarding review screen.

Tip

Keep your ERP code in metadata.erpCode so periodic reconciliation jobs can match your two systems without extra lookup tables.