Skip to main content

Code Examples

This section provides implementation examples in multiple programming languages for integrating with B1Link's vendor number assignment endpoint.

Available Examples​

Common Implementation Pattern​

All implementations follow this pattern:

  1. Create request payload - Build JSON with Id and ErpVendorNumber
  2. Serialize to compact JSON - No whitespace, proper property order
  3. Generate signature - HMAC-SHA256 with API key, Base64 encode
  4. Send HTTP PUT request - Include signature in X-B1LINK-Signature header
  5. Handle response - Check for 204 status code

Key Requirements​

  • ✅ Compact JSON format (no whitespace)
  • ✅ Property order: Id first, then ErpVendorNumber
  • ✅ UTF-8 encoding
  • ✅ HMAC-SHA256 signature
  • ✅ Base64 encoding of signature
  • ✅ HTTPS only

Next Steps​

Choose your preferred language and follow the implementation example.