مرجع الواجهة البرمجية
هذا المفتاح
لمن يعود المفتاح وما الذي يحق له — أول طلب ترسله بمفتاح جديد.
الأوصاف التقنية أدناه بالإنجليزية كما يولّدها خادم الواجهة، وهي اللغة التي تُكتب بها رسائل الأخطاء أيضًا. العناوين والجداول بالعربية.
مستند OpenAPI
يُولَّد هذا المرجع من مستند OpenAPI 3.0 الذي تنشره الواجهة نفسها. وجّه مولّد العميل لديك إليه:
https://app.kwn.tax/api/v1/openapi.jsonوصف هذا المفتاح
GET/me
The key's merchant, the key itself with its scopes, the capabilities those scopes carry under the merchant's plan, the apps the key reaches, and the e-invoicing provider mode of this server (MOCK is a sandbox).
أمثلة برمجية
curl -sS -X GET "https://app.kwn.tax/api/v1/me" \
-H "X-Api-Key: $KWN_API_KEY"الاستجابات
200OK
الحقل النوع الوصف merchantobjectkeyobjectcapabilitiesstring[]appsstring[]eInvoicingobject400Refused: the request or a business rule. The code says which (REQUEST_INVALID, RULE_REFUSED, …).
{ "error": "Lines: at least one line is required.", "code": "REQUEST_INVALID" }401No key, a key that is not ours, or one revoked (API_KEY_INVALID); a merchant not active (MERCHANT_INACTIVE).
{ "error": "That API key is not valid, or it was revoked.", "code": "API_KEY_INVALID" }403The key's scopes do not carry the capability (APP_NOT_GRANTED, ROLE_TOO_LOW), or the plan lacks the app (APP_LOCKED).
{ "error": "This key's scopes do not include sales.approve.", "code": "ROLE_TOO_LOW" }404Not found: another type under this route, or another company's (NOT_FOUND).
{ "error": "Not found.", "code": "NOT_FOUND" }409A conflict: an externalId taken, or a change that could not be saved (EXTERNAL_ID_TAKEN, CONFLICT).
{ "error": "That externalId is already used by another record of this company.", "code": "EXTERNAL_ID_TAKEN" }429Too many requests: wait retryAfter seconds (RATE_LIMITED).
{ "error": "Too many requests. Wait a little and try again.", "code": "RATE_LIMITED" }