Skip to main content

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:

  1. Test with a single onboarding request
  2. Verify the vendor number appears correctly in B1Link
  3. Monitor logs for any errors
  4. Gradually increase the volume of requests

Test Scenarios

Success Scenario

  1. Receive webhook from B1Link
  2. Extract event ID
  3. Assign vendor number
  4. Send vendor number to B1Link
  5. Verify 204 response
  6. Confirm vendor number in B1Link portal

Error Scenarios

  1. Invalid Signature - Test with incorrect API key
  2. Missing Header - Test without signature header
  3. Invalid Event ID - Test with non-existent event ID
  4. Malformed JSON - Test with invalid JSON payload
  5. Network Timeout - Test with network connectivity issues

Debugging Tips

  1. Log the exact JSON string you're signing (without the API key)
  2. Compare signatures with a known-good example
  3. Verify property order in JSON (Id first, then ErpVendorNumber)
  4. Check encoding - Ensure UTF-8 encoding throughout
  5. Validate Base64 - Verify Base64 encoding is correct

Next Steps