Partners
KAT partner developer guide
How a KAT partner activates customers and connects them to its own service with the partner API and webhooks. The console is currently in Korean. Partner types and conditions are on the partner program page and in the Partner Terms.
01
Registering as a partner
- Open app.katcloud.kr/partners/join. If you are not signed in, you sign in or sign up first and then continue to the registration screen.
- Choose the partner type. You can choose more than one.
- Enter the partner name and the email address that receives a copy of the terms.
- If you chose KAT Solution Partner or KAT Platform Partner, select or register a business.
- Agree to the Partner Terms (Korean) and register.
If you chose only KAT Referral Partner and KAT Technology Partner, the partner workspace opens as soon as you register. If KAT Solution Partner or KAT Platform Partner is included, it opens after an operator checks the business. Registering does not change your existing projects, numbers or billing. The conditions for each type are on the partner program page.
02
Partner workspace
After registration, an entry named 파트너: followed by the partner name appears in the switcher at the top left of the console. Choosing it switches to the partner workspace. The menus you see depend on your role.
| Menu | What it does | Roles that can see it |
|---|---|---|
| Customers (고객사) | The list and summary of this partner's customer projects and their billing status (whether the partner pays, whether a card is registered). You create Activation Links, see their history and turn them off here. | All members (Activation Links: administrators and operators) |
| Credit and usage (크레딧·사용량) | Partner credit balance, monthly usage per customer, and the history of top-ups and deductions. View only. | All members |
| Members (멤버) | The people who can enter the workspace and their roles (administrator, operator, viewer). Members are invited by email. | Administrators |
| Developer (개발자) | Partner API keys, partner webhooks, alert emails, and how to create Activation Links through the API. | Administrators |
| Billing (결제) | The card and payment history for the KAT Platform Partner account fee. Shown only to partners that have an account fee. | Administrators |
| Referral commission (소개 수수료) | Referral link, customers who signed up through a referral, monthly statements, settlement details and the commission policy. | All members (settlement details: administrators) |
Credit top-ups and adjustments are made by KAT Cloud. Notifications of customer suspension, non-payment and the concurrent call limit are sent by email as well as by webhook. Set the receiving addresses under alert emails (알림 메일) on the Developer (개발자) screen; if left empty, they go to the invoice email address.
03
Customer Activation Links
An Activation Link is the sign-up address you send to the customer's representative. In the console it is shown as 온보딩 링크. Create it on the Customers (고객사) screen of the partner workspace or through the partner API. The rules are the same either way, and links appear in the same history. The defaults are a single use and expiry after 7 days; you can set up to 100 uses and 30 days. Numbers are activated in the customer's name.
Steps the customer goes through
| Step | What happens |
|---|---|
| Identity verification of the representative | The representative of the business verifies their identity with their own mobile phone. The number is registered in the representative's name. The verification result is valid for 10 minutes only; after that, only the identity verification is repeated. |
| Account | The customer sets the password for signing in to the KAT Cloud console. If an account already exists, the company is added to the same account. |
| Business verification | The customer enters the business type, business registration number, company name and representative, and uploads the business registration certificate (PNG, JPG, TIF or PDF, up to 10MB). Activation is not possible if the representative's name differs from the verified name. |
| Consent to the terms | In addition to the Terms of Use and the Privacy Policy, two required consents that apply only to activation through a partner are obtained (see the table below). |
| Activation completed | A project and one 070 number are created immediately, and the KATCLOUD_ONBOARDING_COMPLETED webhook is sent to the partner. The customer then registers a card for payment. |
Required consents for activation through a partner
| Consent | Content | Basis |
|---|---|---|
| Provision of information to the Partner | The customer consents to providing the Partner with the connected numbers, the result of activation, service usage status and information necessary for call handling. | Terms of Use, Article 9-4 |
| Confirmation of the number porting notice | The customer confirms the notice that number porting follows the procedures and conditions of the type of number and the partner carrier, and that the Company cooperates in accordance with those procedures when the customer applies. | Terms of Use, Article 20-2 |
At the terms step the customer also chooses whether to delegate adding numbers to the partner (optional). Only if delegated, and only up to the delegated count, can you attach more numbers to that customer through the partner API. Even after a Partner Connection ends, the customer can continue to use the number with KAT Cloud.
Trial Activation Links
Use this link to test your integration. Activation needs only mobile phone identity verification and consent to the terms, with no business step. It starts as a 7-day trial and no charges are made. After the trial ends, the number is reclaimed automatically. The number of uses is fixed at one, and the trial is once per person, so a person who has already had a trial cannot activate through a trial link. The activation completed webhook carries trial: true and trialEndsAt.
04
Billing methods
| Method | Who pays | Conditions |
|---|---|---|
| Customer pays (default) | The customer pays KAT Cloud directly with its own card. | Every newly activated customer starts with this method. |
| Paying Partner | Charges are paid from partner credit. | Only a partner that has passed the review for paying on behalf of customers can switch, customer by customer. Message charges cannot be paid on behalf of the customer. |
- A customer activated through an Activation Link starts as a paid customer immediately, without a trial. There is no base fee; numbers, calls and messages are charged at the unit prices in the public price list.
- A partner administrator changes the billing method in the billing section of the customer details. The change applies from the next billing period, and a text message is sent to the customer's representative.
- The KAT Platform Partner account is KRW 50,000 a month (VAT excluded). When you register a card on the Billing (결제) screen of the partner workspace, the first month is charged immediately and then monthly from that day. Before the first payment or while the fee is unpaid, only new Activation Links cannot be created; customers already activated are not affected.
- What a partner charges its customers for its own features is separate from KAT Cloud charges.
Pricing·Partner Terms (paying on behalf, partner account fee; Korean)
05
Partner API
The partner's server uses this API to create Activation Links and query customers. Its base URL and key are different from those of the API in the API docs, which handles calls and messages inside a customer project.
| Item | Value |
|---|---|
| Base URL | https://b2b-gateway.zerocall.kr |
| Authentication | Put the partner API key in the x-api-key header of every request. |
| Issuing a key | Press 키 만들기 (create key) under Developer (개발자) in the partner workspace. The key is shown only once, when it is created. Choose no expiry, 90 days or 1 year. |
| Revoking a key | Revoke it on the same screen. A revoked key is rejected within 5 minutes at the latest. |
Authentication errors
| Status | Code | When |
|---|---|---|
| 401 | BB002 | The x-api-key header is missing |
| 401 | BB003 | The key is wrong or has been revoked. A revoked key is rejected with this code within 5 minutes at the latest |
| 401 | BB004 | The key has expired |
| 402 | BB009 | The partner's service is suspended because its partner credit balance is insufficient |
| 403 | BB005 | The project (groupId) does not belong to your partner |
Main routes
| Method | Path | Description |
|---|---|---|
| POST | /api/v1/katcloud/onboarding-url | Create a customer Activation Link |
| GET | /api/v1/katcloud/onboarding-url | List Activation Links (most recent first) |
| DELETE | /api/v1/katcloud/onboarding-url/{tokenId} | Turn off an Activation Link. Customers that have already activated are not affected |
| GET | /api/v1/katcloud/onboarding-results | Query activation results. Send at least one of tokenId and businessNumber as a query parameter. The fields are the same as data in the activation completed webhook |
| GET | /api/v1/katcloud/group | List customer projects. Use the businessNumber query parameter to see one business only |
| GET | /api/v1/katcloud/group/{groupId} | One customer project (business, 070 numbers, subscription status, whether suspended) |
| GET | /api/v1/katcloud/group/{groupId}/numbers/quote | Preview the monthly fee added by one more number |
| POST | /api/v1/katcloud/group/{groupId}/numbers | Add one 070 number. Requires the Idempotency-Key header and confirmMonthlyFee: true in the body |
| DELETE | /api/v1/katcloud/group/{groupId}/numbers/{number} | Return one number |
| GET | /api/v1/katcloud/statements | Statements per customer for periods paid from partner credit. Query parameters from and to (up to 92 days), groupId optional |
{groupId}is the customer project ID. A project that does not belong to your partner is rejected with 403 BB005. The name and mobile number of the customer's representative are not included in responses.
Creating an Activation Link
# Register the returnUrl domain on the Developer screen of the partner workspace first (otherwise KC185)
curl -X POST "https://b2b-gateway.zerocall.kr/api/v1/katcloud/onboarding-url" \
-H "x-api-key: $KAT_PARTNER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Hanbit Trading",
"externalCustomerId": "cust_1024",
"returnUrl": "https://app.example.com/kat/done"
}'| Request field | Type | Description |
|---|---|---|
| name | string | Optional. Link name (for example the customer name), up to 100 characters. Returned as tokenName in the activation completed webhook |
| externalCustomerId | string | Optional. The customer ID in the partner's system, up to 255 characters. Returned as externalCustomerId in the webhook |
| expiresAt | string | Optional. Expiry date and time (ISO 8601). Default 7 days later, within 30 days from now (otherwise KC137) |
| maxUses | number | Optional. Maximum number of uses, 1 to 100. Default 1 (one link per customer) |
| businessNumber | string | Optional. Business registration number, 10 digits (hyphens allowed). If set, only that business can activate |
| returnUrl | string | Optional. The partner service URL (https) the customer returns to after activation. Its domain must be registered under Developer (개발자) in the partner workspace (otherwise KC185) |
| trial | boolean | Optional. true creates a trial Activation Link. Cannot be used together with businessNumber (KC191) |
{
"tokenId": 345,
"onboardingUrl": "<activation URL to send to the customer's representative>",
"expiresAt": "2026-12-05T02:00:00.000Z",
"trial": false,
"warnings": []
}| Response field | Type | Description |
|---|---|---|
| tokenId | number | Link ID. Used to turn the link off and as tokenId in the activation completed webhook |
| onboardingUrl | string | The activation URL to send to the customer's representative |
| expiresAt | string | Expiry date and time (ISO 8601) |
| trial | boolean | Whether this is a trial Activation Link |
| warnings | array | Things to note. Currently always an empty array |
Querying activation results
Use this when you did not receive the activation completed webhook. The response is a results array, and the fields of each item are the same as data in KATCLOUD_ONBOARDING_COMPLETED. It is an empty array if the customer has not activated yet.
curl "https://b2b-gateway.zerocall.kr/api/v1/katcloud/onboarding-results?tokenId=345" \
-H "x-api-key: $KAT_PARTNER_API_KEY"| results[] field | Type | Description |
|---|---|---|
| b2bClientId | number | Partner ID |
| tokenId | number | null | The ID of the link used for activation. null if the activation has no link record |
| tokenName | string | null | Link name |
| externalCustomerId | string | null | The externalCustomerId set when the link was created |
| groupId | number | Customer project ID |
| groupName | string | Project name |
| phoneNumber | string | null | The primary 070 number |
| businessNumber | string | null | The customer's business registration number (10 digits without hyphens). An empty string for a trial link |
| companyName | string | null | The customer's company name. The project name for a trial link |
| completedAt | string | Activation date and time (when the project was created, ISO 8601) |
| trial | boolean | true if activated through a trial link |
| trialEndsAt | string | null | The end of the trial (ISO 8601) for a trial, otherwise null |
If you send both tokenId and businessNumber, only items that match both are returned. If neither is sent, the response is 400. A tokenId that is not a link of your partner returns 404 BB021.
Listing Activation Links
The response of GET /api/v1/katcloud/onboarding-url is a urls array.
| urls[] field | Type | Description |
|---|---|---|
| tokenId | number | Link ID |
| name | string | null | Link name |
| externalCustomerId | string | null | The customer ID in the partner's system |
| businessNumber | string | null | The business registration number set for the link (10 digits). null if none |
| returnUrl | string | null | The URL to return to after activation. null if none |
| trial | boolean | Whether this is a trial Activation Link |
| onboardingUrl | string | Activation URL |
| expiresAt | string | Expiry date and time (ISO 8601) |
| maxUses | number | null | Maximum number of uses |
| currentUses | number | Number of times used for activation |
| isActive | boolean | Whether the link is turned on |
| isValid | boolean | Whether the link can be used now (turned on, not expired, uses remaining) |
| createdAt | string | Creation date and time (ISO 8601) |
| completedGroupIds | number[] | IDs of the customer projects activated through this link (in order of activation) |
Querying customer projects
The response of GET /api/v1/katcloud/group is a groups array, and GET /api/v1/katcloud/group/{groupId} returns one item of the same shape. Cancelled projects do not appear in the list. Projects suspended by KAT Cloud can still be queried.
| Field | Type | Description |
|---|---|---|
| groupId | number | Customer project ID |
| groupName | string | Project name (the company name at activation) |
| businessNumber | string | null | The customer's business registration number (10 digits without hyphens) |
| companyName | string | null | The customer's company name |
| numbers | array | The 070 numbers currently attached. Each item has channelId (number), phoneNumber (string) and isPrimary (boolean, whether it is the first number received) |
| subscription | object | null | Subscription. status (ACTIVE in use, UNPAID unpaid and in the grace period, SUSPENDED stopped after the grace period, CANCELED cancelled), plan, periodStartedAt, periodEndsAt, unpaidSince (only during the grace period, otherwise null) |
| adminSuspended | boolean | Whether the project is suspended by KAT Cloud |
| createdAt | string | Activation date and time (ISO 8601) |
Adding and returning numbers
You can add numbers only if the customer delegated adding numbers at activation, and only up to the delegated count. First check the added monthly fee with the preview, then send the add request with the Idempotency-Key header (1 to 128 characters) and the body { "confirmMonthlyFee": true }. Sending again with the same key returns the number that was attached the first time. The number fee is paid from the next billing period by whoever pays for that customer.
| Preview response field | Type | Description |
|---|---|---|
| groupId | number | Customer project ID |
| numbers | number | Number of 070 numbers currently attached |
| addedMonthlyFee | number | The monthly fee added by one more number (supply price, KRW) |
| currency | string | KRW |
| blockedCode | string | null | The error code if a number cannot be added now. Adding is rejected with the same code |
| Add response field (201) | Type | Description |
|---|---|---|
| groupId | number | Customer project ID |
| channelId | number | Channel ID of the added number |
| phoneNumber | string | The added 070 number |
| addedMonthlyFee | number | The added monthly fee (supply price, KRW) |
| currency | string | KRW |
| notice | string | Notice text |
| Return response field (200) | Type | Description |
|---|---|---|
| groupId | number | Customer project ID |
| channelId | number | Channel ID of the returned number |
| phoneNumber | string | The returned 070 number |
| released | boolean | true if this request returned the number |
| alreadyReleased | boolean | true if the number had already been returned |
| releasedAt | string | null | Date and time of return |
| removedMonthlyFee | number | The monthly fee removed from the next billing period (supply price, KRW). 0 if already returned |
| currency | string | KRW |
| notice | string | Notice text |
The first number received and the last remaining number cannot be returned (409 KC117). Returning a number that has already been returned gives 200 with alreadyReleased: true.
Statements per customer
GET /api/v1/katcloud/statements takes the query parameters from and to (ISO 8601, based on the start date of the billing period, up to 92 days) and an optional groupId. The response is a statements array and the overall totals (supply, vat, total). Only periods paid from partner credit are included; periods the customer paid directly with its own card are left out. If the period is reversed or longer than 92 days, the response is 400 BB051.
| statements[] field | Type | Description |
|---|---|---|
| groupId | number | Customer project ID |
| groupName | string | Project name |
| groupRemoved | boolean | true for a cancelled project |
| businessNumber | string | null | The customer's business registration number |
| periodId | number | Billing period ID |
| plan | string | Plan key |
| startedAt | string | Start of the billing period |
| endsAt | string | End of the billing period |
| usageCountedAt | string | When usage was last counted |
| monthlyFee | object | Monthly fee. supply, vat, total, charged (whether it was actually deducted) |
| fixedFees | object | Fixed monthly fees such as numbers. lines, supply, vat, total, charged |
| contract | boolean | Whether the period was counted at contract prices |
| planUpgradeCharges | number[] | Differences deducted for plan upgrades during the period (VAT included) |
| lines | array | Usage detail lines |
| usage | object | Usage charges actually deducted. supply, vat, total |
| totals | object | Total amount actually deducted. supply, vat, total |
| unchargedAiModels | string[] | AI models not billed because they are not in the price table |
06
Partner webhooks
Partner webhooks tell the partner's server about its customers' activation and status. Register one URL per event under Developer (개발자) › Partner webhooks (본사 웹훅) in the partner workspace. Payload examples, fields and delivery rules are in KAT partner webhooks in the webhook guide.
| Event | When it arrives |
|---|---|
| KATCLOUD_ONBOARDING_COMPLETED | A customer finished activation through an Activation Link, and its project and 070 number were created. |
| KATCLOUD_CUSTOMER_STATUS_CHANGED | A customer's status changed (suspended by KAT Cloud, unpaid, suspended for non-payment, back to normal). |
| KATCLOUD_CONCURRENCY_LIMIT_REACHED | A customer hit its concurrent call limit and missed calls, or lines were added automatically. The limit notification is sent once per hour per customer. |
Signatures for partner webhooks are in preparation. They are currently sent without signature headers, so if you apply the signature verification for project webhooks to this URL, the requests are rejected. Until signatures are available, use a receiving URL that is hard to guess. For important actions such as suspension or activation, do not rely on the notification alone: check the status again with the partner API before you proceed.
There is no eventId at the top of the body. An activation completed notification is created only once per customer and is not sent again when a customer that has already activated opens the link again. The same notification can arrive again through a delivery retry, so deduplicate it by data.groupId.
07
Code examples
The examples below use only the routes and fields in the tables of this guide. Keep the key in the environment variable KAT_PARTNER_API_KEY and do not write it in your code. Customer names and IDs are made-up values.
From start to finish
- Create a partner API key on the Developer (개발자) screen of the partner workspace.
- Under Partner webhooks (본사 웹훅) on the same screen, register a receiving URL for each event and press 시험 보내기 (send test) to check that your server answers 200.
- Create a trial Activation Link.
- Open the link and activate with mobile phone identity verification and consent to the terms.
- Your server receives the
KATCLOUD_ONBOARDING_COMPLETEDwebhook. - Query activation results, check that the same project is returned, and then reflect it in your own service.
Setup
The Node.js and Python examples share the call function below.
export KAT_PARTNER_API_KEY="<partner API key>"// Node.js 18 or later (built-in fetch). No other packages are needed.
// In the examples below, run the lines with await inside an async function
const BASE_URL = "https://b2b-gateway.zerocall.kr";
const API_KEY = process.env.KAT_PARTNER_API_KEY; // <partner API key>
// The call function shared by the examples below
async function partnerApi(method, path, body, headers) {
const res = await fetch(BASE_URL + path, {
method: method,
headers: Object.assign({ "x-api-key": API_KEY, "Content-Type": "application/json" }, headers),
body: body ? JSON.stringify(body) : undefined,
});
if (!res.ok) throw new Error(method + " " + path + " -> " + res.status);
const text = await res.text();
return text ? JSON.parse(text) : null; // null for a response without a body
}import os
import requests
BASE_URL = "https://b2b-gateway.zerocall.kr"
session = requests.Session()
session.headers["x-api-key"] = os.environ["KAT_PARTNER_API_KEY"] # <partner API key>
# The call function shared by the examples below
def partner_api(method, path, **kwargs):
res = session.request(method, BASE_URL + path, timeout=10, **kwargs)
res.raise_for_status()
return res.json() if res.content else None # null for a response without a bodyCreate an Activation Link
Create a link with name, externalCustomerId and returnUrl. Send onboardingUrl in the response to the customer's representative.
# Register the returnUrl domain on the Developer screen of the partner workspace first (otherwise KC185)
curl -X POST "https://b2b-gateway.zerocall.kr/api/v1/katcloud/onboarding-url" \
-H "x-api-key: $KAT_PARTNER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Hanbit Trading",
"externalCustomerId": "cust_1024",
"returnUrl": "https://app.example.com/kat/done"
}'// Register the returnUrl domain on the Developer screen of the partner workspace first (otherwise KC185)
const link = await partnerApi("POST", "/api/v1/katcloud/onboarding-url", {
name: "Hanbit Trading",
externalCustomerId: "cust_1024",
returnUrl: "https://app.example.com/kat/done",
});
// Send onboardingUrl to the customer's representative
console.log(link.tokenId, link.onboardingUrl, link.expiresAt);# Register the returnUrl domain on the Developer screen of the partner workspace first (otherwise KC185)
link = partner_api("POST", "/api/v1/katcloud/onboarding-url", json={
"name": "Hanbit Trading",
"externalCustomerId": "cust_1024",
"returnUrl": "https://app.example.com/kat/done",
})
# Send onboardingUrl to the customer's representative
print(link["tokenId"], link["onboardingUrl"], link["expiresAt"])Create a trial Activation Link
Send trial as true. It cannot be used together with businessNumber.
# Trial Activation Link: no business step, 7-day trial, single use
curl -X POST "https://b2b-gateway.zerocall.kr/api/v1/katcloud/onboarding-url" \
-H "x-api-key: $KAT_PARTNER_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "name": "Integration test", "trial": true }'// Trial Activation Link: no business step, 7-day trial, single use
const trialLink = await partnerApi("POST", "/api/v1/katcloud/onboarding-url", {
name: "Integration test",
trial: true,
});
console.log(trialLink.tokenId, trialLink.onboardingUrl, trialLink.trial);# Trial Activation Link: no business step, 7-day trial, single use
trial_link = partner_api("POST", "/api/v1/katcloud/onboarding-url", json={
"name": "Integration test",
"trial": True,
})
print(trial_link["tokenId"], trial_link["onboardingUrl"], trial_link["trial"])Query activation results
Query with the tokenId you received when you created the link. The results array in the response contains the customers that have activated.
curl "https://b2b-gateway.zerocall.kr/api/v1/katcloud/onboarding-results?tokenId=345" \
-H "x-api-key: $KAT_PARTNER_API_KEY"const found = await partnerApi("GET", "/api/v1/katcloud/onboarding-results?tokenId=345");
// An empty array if the customer has not activated yet
for (const r of found.results) {
console.log(r.groupId, r.groupName, r.phoneNumber, r.completedAt, r.trial);
}found = partner_api("GET", "/api/v1/katcloud/onboarding-results", params={"tokenId": 345})
# An empty array if the customer has not activated yet
for r in found["results"]:
print(r["groupId"], r["groupName"], r["phoneNumber"], r["completedAt"], r["trial"])List customer projects
Read the project ID, numbers, subscription status and suspension from the groups array in the response.
curl "https://b2b-gateway.zerocall.kr/api/v1/katcloud/group" \
-H "x-api-key: $KAT_PARTNER_API_KEY"const list = await partnerApi("GET", "/api/v1/katcloud/group");
for (const g of list.groups) {
const numbers = g.numbers.map((n) => n.phoneNumber).join(", ");
const status = g.subscription ? g.subscription.status : null;
console.log(g.groupId, g.groupName, numbers, status, g.adminSuspended);
}data = partner_api("GET", "/api/v1/katcloud/group")
for g in data["groups"]:
numbers = ", ".join(n["phoneNumber"] for n in g["numbers"])
status = g["subscription"]["status"] if g["subscription"] else None
print(g["groupId"], g["groupName"], numbers, status, g["adminSuspended"])Add a number
Check the added monthly fee with the preview, then add the number with the Idempotency-Key header and confirmMonthlyFee: true. This works only if the customer delegated adding numbers.
# 1. Check the added monthly fee (supply price, KRW) before you proceed
curl "https://b2b-gateway.zerocall.kr/api/v1/katcloud/group/789/numbers/quote" \
-H "x-api-key: $KAT_PARTNER_API_KEY"
# 2. If you did not get a response, send again with the same key
IDEMPOTENCY_KEY="$(uuidgen)"
curl -X POST "https://b2b-gateway.zerocall.kr/api/v1/katcloud/group/789/numbers" \
-H "x-api-key: $KAT_PARTNER_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-d '{ "confirmMonthlyFee": true }'const { randomUUID } = require("node:crypto");
const groupId = 789;
// 1. Check the added monthly fee (supply price, KRW) before you proceed
const quote = await partnerApi("GET", "/api/v1/katcloud/group/" + groupId + "/numbers/quote");
if (quote.blockedCode) throw new Error("Cannot add a number now: " + quote.blockedCode);
console.log(quote.numbers, quote.addedMonthlyFee, quote.currency);
// 2. If you did not get a response, send again with the same key
const idempotencyKey = randomUUID();
const added = await partnerApi(
"POST",
"/api/v1/katcloud/group/" + groupId + "/numbers",
{ confirmMonthlyFee: true },
{ "Idempotency-Key": idempotencyKey },
);
console.log(added.phoneNumber, added.addedMonthlyFee);import uuid
group_id = 789
# 1. Check the added monthly fee (supply price, KRW) before you proceed
quote = partner_api("GET", "/api/v1/katcloud/group/" + str(group_id) + "/numbers/quote")
if quote["blockedCode"]:
raise RuntimeError("Cannot add a number now: " + quote["blockedCode"])
print(quote["numbers"], quote["addedMonthlyFee"], quote["currency"])
# 2. If you did not get a response, send again with the same key
idempotency_key = str(uuid.uuid4())
added = partner_api(
"POST",
"/api/v1/katcloud/group/" + str(group_id) + "/numbers",
json={"confirmMonthlyFee": True},
headers={"Idempotency-Key": idempotency_key},
)
print(added["phoneNumber"], added["addedMonthlyFee"])Webhook receiving server
The server branches on eventType for the three events. It answers 2xx within 10 seconds first and processes afterwards. It deduplicates status changes and the concurrent call limit by data.eventId and activation completed by data.groupId. Test notifications are filtered by isTest and are not passed to real processing. Signatures are in preparation, so for actions such as activation and suspension it queries the status again with the partner API before proceeding. It uses the call function from the setup above.
const http = require("node:http");
// Use a receiving URL that is hard to guess
const WEBHOOK_PATH = "/kat/webhook/" + process.env.KAT_WEBHOOK_PATH_TOKEN;
// Notifications already handled. In production, use a unique key in your database
const handled = new Set();
http
.createServer((req, res) => {
if (req.method !== "POST" || req.url !== WEBHOOK_PATH) {
res.writeHead(404).end();
return;
}
let raw = "";
req.on("data", (chunk) => {
raw += chunk;
});
req.on("end", () => {
let event;
try {
event = JSON.parse(raw);
} catch (error) {
res.writeHead(400).end();
return;
}
// Answer 2xx within 10 seconds first, then process
res.writeHead(200).end("OK");
handle(event).catch((error) => console.error(error));
});
})
.listen(3000);
async function handle(event) {
const data = event.data || {};
// A test sent from the console. Do not pass it to real processing
if (event.isTest) {
console.log("test", event.eventType);
return;
}
// Deduplicate activation by data.groupId and the others by data.eventId
const key =
event.eventType === "KATCLOUD_ONBOARDING_COMPLETED"
? event.eventType + ":" + data.groupId
: event.eventType + ":" + data.eventId;
if (handled.has(key)) return;
handled.add(key);
switch (event.eventType) {
case "KATCLOUD_ONBOARDING_COMPLETED": {
// Signatures are in preparation. Do not rely on the notification alone: query the partner API again
const found = await partnerApi("GET", "/api/v1/katcloud/onboarding-results?tokenId=" + data.tokenId);
const result = found.results.find((r) => r.groupId === data.groupId);
// If the query does not return it, do not process it
if (!result) return;
// Mark the customer as activated in your service here
console.log("activated", result.externalCustomerId, result.groupId, result.phoneNumber, result.trial);
break;
}
case "KATCLOUD_CUSTOMER_STATUS_CHANGED": {
// Signatures are in preparation. Do not rely on the notification alone: query the partner API again
const group = await partnerApi("GET", "/api/v1/katcloud/group/" + data.groupId);
const subscription = group.subscription ? group.subscription.status : null;
const stopped = group.adminSuspended || subscription === "SUSPENDED";
// Update the customer status in your service to match what you queried
console.log("status", group.groupId, data.status, stopped, data.partnerAction, data.customerMessage);
break;
}
case "KATCLOUD_CONCURRENCY_LIMIT_REACHED":
// For information. Pass customerMessage on to the customer
console.log("concurrency", data.groupId, data.limit, data.direction, data.addedLines, data.customerMessage);
break;
default:
// Skip unknown eventType values
break;
}
}import os
import threading
from flask import Flask, request
app = Flask(__name__)
# Use a receiving URL that is hard to guess
WEBHOOK_PATH = "/kat/webhook/" + os.environ["KAT_WEBHOOK_PATH_TOKEN"]
# Notifications already handled. In production, use a unique key in your database
handled = set()
handled_lock = threading.Lock()
@app.post(WEBHOOK_PATH)
def webhook():
event = request.get_json(silent=True)
if not isinstance(event, dict):
return "bad request", 400
# Answer 2xx within 10 seconds first, then process
threading.Thread(target=handle, args=(event,), daemon=True).start()
return "OK", 200
def handle(event):
event_type = event.get("eventType")
data = event.get("data") or {}
# A test sent from the console. Do not pass it to real processing
if event.get("isTest"):
print("test", event_type)
return
# Deduplicate activation by data.groupId and the others by data.eventId
if event_type == "KATCLOUD_ONBOARDING_COMPLETED":
key = event_type + ":" + str(data.get("groupId"))
else:
key = str(event_type) + ":" + str(data.get("eventId"))
with handled_lock:
if key in handled:
return
handled.add(key)
if event_type == "KATCLOUD_ONBOARDING_COMPLETED":
# Signatures are in preparation. Do not rely on the notification alone: query the partner API again
found = partner_api("GET", "/api/v1/katcloud/onboarding-results", params={"tokenId": data["tokenId"]})
result = next((r for r in found["results"] if r["groupId"] == data["groupId"]), None)
# If the query does not return it, do not process it
if result is None:
return
# Mark the customer as activated in your service here
print("activated", result["externalCustomerId"], result["groupId"], result["phoneNumber"], result["trial"])
elif event_type == "KATCLOUD_CUSTOMER_STATUS_CHANGED":
# Signatures are in preparation. Do not rely on the notification alone: query the partner API again
group = partner_api("GET", "/api/v1/katcloud/group/" + str(data["groupId"]))
subscription = group["subscription"]["status"] if group["subscription"] else None
stopped = group["adminSuspended"] or subscription == "SUSPENDED"
# Update the customer status in your service to match what you queried
print("status", group["groupId"], data["status"], stopped, data["partnerAction"], data["customerMessage"])
elif event_type == "KATCLOUD_CONCURRENCY_LIMIT_REACHED":
# For information. Pass customerMessage on to the customer
print("concurrency", data["groupId"], data["limit"], data["direction"], data["addedLines"], data["customerMessage"])
# Skip unknown eventType values08
Referral commissions and referral links
- A referral link has the form
app.katcloud.kr/r/<code>. Find yours on the Referral commission (소개 수수료) screen of the partner workspace. - Clicking the link goes to the website, and the referral code and the time the link was clicked are stored in that browser for 183 days. If a sign-up is made in the same browser during that time, it is recorded as that partner's referral. The stored value is deleted once sign-up is completed.
- The link that goes straight to the sign-up screen is
app.katcloud.kr/auth/signup?ref=<code>. The sign-up screen opens without going through the website, and the sign-up is recorded with the same referral code. - If several referral links were clicked in the same browser, the first one clicked applies.
- If the customer refuses the storage of cookies, sign-up and use are not affected. In that case the sign-up is not recorded as a referral.
- A referral commission is confirmed 30 days after the customer's first payment.
- A referral counts only if the customer signs up within 6 months of the date the partner registered that customer.
- Referral commissions are paid only to partners that are businesses (including sole proprietors), and the partner issues a tax invoice.
- The payment criteria and period are in the commission policy, which is disclosed only to approved partners. See it on the Referral commission (소개 수수료) screen of the partner workspace.
Partner Terms (commissions; Korean)·Privacy Policy (referral link cookie)
09
Common problems
| Symptom | Cause and fix |
|---|---|
| Creating an Activation Link returns 403 KC209 or KC210 | The first payment of the KAT Platform Partner account fee has not been made (KC209) or the fee is unpaid (KC210). Register a card or pay under Billing (결제) in the partner workspace. Links already created and customers already activated are not affected. |
| The customer cannot open the link | The link has expired or has already been used. The defaults are a single use and 7 days. Create a new link and send it. |
| Activation is blocked at the business step | The representative's name differs from the verified name. The representative must verify their own identity. The link can be passed on with the button 대표자에게 링크 보내기 (send the link to the representative) on the screen. |
| The screen says the business has already been activated | The same business (business registration number) can be activated only once under one partner. |
| Creating a trial Activation Link returns 409 KC194 | There is a limit on the number of trial projects whose numbers have not yet been reclaimed (KC194). You can create a link again after the trial ends and the number is reclaimed. |
| Adding a number returns 403 KC175 or 409 KC176 | The customer did not delegate adding numbers at activation (KC175), or the delegated count has been used up (KC176). In this case the customer adds numbers in their own console. |
| Webhooks do not arrive | Check that a URL is registered for that event under Developer (개발자) › Partner webhooks (본사 웹훅) in the partner workspace. Each event is registered separately. If your server does not answer 2xx within 10 seconds the delivery fails, and it is sent 3 times at most. Query activation results again with GET /api/v1/katcloud/onboarding-results. |
| Webhook signature verification fails | Signatures for partner webhooks are in preparation. They are currently sent without signature headers, so if you apply the signature verification for project webhooks to this URL, the requests are rejected. |
| The activation completed notification arrives only once | An activation completed notification is created only once per customer. It is not sent again when a customer that has already activated opens the link again. If you missed it, query GET /api/v1/katcloud/onboarding-results. |
| The partner API returns 401 | BB002 if the x-api-key header is missing, BB003 if the key is wrong or revoked, BB004 if it has expired. The partner API key and a customer project's API key are different keys, and the base URLs are different too. |
