Testing
This section covers testing procedures and checklists for validating your B1Link integration.
Test Endpoint
B1Link provides a test endpoint for validating your integration:
- Endpoint:
PUT /api/test-onboarding-request-erp-events/{id}/assign-erp-vendor-number - Note: This endpoint does not require signature verification and is intended for testing only
Sample Test Data
{
"Id": "00000000-0000-0000-0000-000000000001",
"ErpVendorNumber": "TEST-VENDOR-001"
}
Testing Checklist
- API key is stored securely
- Signature generation produces correct Base64-encoded HMAC-SHA256 hash
- JSON payload is correctly formatted
- Request headers are set correctly
- Success response (204) is handled
- Error responses are handled appropriately
- Network connectivity to B1Link API is verified
- SSL/TLS certificates are valid
Testing in Production
Before going live:
- Test with a single onboarding request
- Verify the vendor number appears correctly in B1Link
- Monitor logs for any errors
- Gradually increase the volume of requests
Test Scenarios
Success Scenario
- Receive webhook from B1Link
- Extract event ID
- Assign vendor number
- Send vendor number to B1Link
- Verify 204 response
- Confirm vendor number in B1Link portal
Error Scenarios
- Invalid Signature - Test with incorrect API key
- Missing Header - Test without signature header
- Invalid Event ID - Test with non-existent event ID
- Malformed JSON - Test with invalid JSON payload
- Network Timeout - Test with network connectivity issues
Debugging Tips
- Log the exact JSON string you're signing (without the API key)
- Compare signatures with a known-good example
- Verify property order in JSON (Id first, then ErpVendorNumber)
- Check encoding - Ensure UTF-8 encoding throughout
- Validate Base64 - Verify Base64 encoding is correct
Next Steps
- Code Examples - Implementation examples
- Error Handling - Troubleshooting guide