Testing in Development
Learn how to test the Kynode API during development.
Development vs production
Use the same HTTPS endpoint (`https://api.kynode.dev`) for development and production. Behavior and rate limits depend on your API key tier, not on a separate “sandbox” hostname.
Test with real, valid Korean business registration numbers. Mock numbers may return validation or not-found errors that are expected.
Watch `429` responses and `Retry-After` headers so your integration respects rate limits before you ship.
Quick testing with cURL
curl -X POST "https://kynode-api.kynode.workers.dev/v1/verify" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"business_number": "8090903407",
"startDate": "20240101",
"ownerName": "강민구",
"company_name": "노드메트릭스",
"language": "en"
}'Using Postman or Insomnia
Create a workspace and add an environment variable `KYNODE_API_KEY` (never commit the real value).
Add a POST request to `https://api.kynode.dev/v1/verify/business` with headers `Authorization: Bearer {{KYNODE_API_KEY}}` and `Content-Type: application/json`.
Save common bodies (`en`, `ko`, and edge-case numbers) as examples so your team can replay them quickly.
Unit testing examples
Wrap HTTP calls in a small client module so tests can stub network I/O. The examples below assume such a helper exists.
JavaScript
// Jest example
describe('Kynode API', () => {
it('should verify valid business number', async () => {
const response = await fetch('https://kynode-api.kynode.workers.dev/v1/verify', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
business_number: '8090903407',
startDate: '20240101',
ownerName: '강민구',
company_name: '노드메트릭스',
language: 'en',
}),
});
const result = await response.json();
expect(result.isValid).toBe(true);
expect(result.businessInfo.status).toBe('Active');
});
});Python
# pytest example
import requests
def test_verify_business():
response = requests.post(
'https://kynode-api.kynode.workers.dev/v1/verify',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
json={
'business_number': '8090903407',
'startDate': '20240101',
'ownerName': '강민구',
'company_name': '노드메트릭스',
'language': 'en',
}
)
result = response.json()
assert result['isValid'] == True
assert result['businessInfo']['status'] == 'Active'Rate limit testing
Deliberately trigger throttling in a non-production environment by sending short bursts of requests, then assert that your client backs off and surfaces a clear error.
Error scenario testing
Add cases for invalid number formats, not-found registrations, expired keys, and timeout handling so regressions are caught in CI.