# Admin Member Confirm 2FA Key Source: https://docs.unibee.dev/api-reference/admin-member/admin-member-confirm-2fa-key post /merchant/member/confirm_totp_key ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/member/confirm_totp_key` Admin Member Confirm 2FA Key *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------- | ------- | -------- | --------------------------------------------------------------------------------------------------------------------------------- | | `totpCode` | string | No | The totp code | | `totpKey` | string | No | TotpKey | | `totpType` | integer | No | 1-General, Google Authenticator \| 2-Microsoft Authenticator \| 3-Authy \| 4-1Password \| 5-LastPass \| 6-FreeOTP \| 7-Other TOTP | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/member/confirm_totp_key" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "totpCode": "", "totpKey": "", "totpType": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/member/confirm_totp_key" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "totpCode": "", "totpKey": "", "totpType": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Admin Member Get 2FA Key Source: https://docs.unibee.dev/api-reference/admin-member/admin-member-get-2fa-key post /merchant/member/get_totp_key ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/member/get_totp_key` Admin Member Get 2FA Key *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------- | ------- | -------- | --------------------------------------------------------------------------------------------------------------------------------- | | `totpType` | integer | No | 1-General, Google Authenticator \| 2-Microsoft Authenticator \| 3-Authy \| 4-1Password \| 5-LastPass \| 6-FreeOTP \| 7-Other TOTP | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/member/get_totp_key" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "totpType": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/member/get_totp_key" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "totpType": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.totpKey` | string | TotpKey, used on next confirm step | | `data.totpResumeCode` | string | TotpResumeCode | | `data.totpType` | integer | 1-General, Google Authenticator \| 2-Microsoft Authenticator \| 3-Authy \| 4-1Password \| 5-LastPass \| 6-FreeOTP \| 7-Other TOTP | | `data.totpUrl` | string | TotpUrl, Used to generate QR Image | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Admin Member Reset Member 2FA Key Source: https://docs.unibee.dev/api-reference/admin-member/admin-member-reset-member-2fa-key post /merchant/member/reset_totp ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/member/reset_totp` Admin Member Reset Member 2FA Key *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------- | ------ | -------- | ------------- | | `totpCode` | string | No | The totp code | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/member/reset_totp" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "totpCode": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/member/reset_totp" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "totpCode": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.merchantMember` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Admin Owner Clear Member 2FA Key Source: https://docs.unibee.dev/api-reference/admin-member/admin-owner-clear-member-2fa-key post /merchant/member/clear_member_totp ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/member/clear_member_totp` Admin Owner Clear Member 2FA Key *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------- | ------- | -------- | ----------------------- | | `memberId` | integer | No | The unique id of member | | `totpCode` | string | No | The admin totp code | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/member/clear_member_totp" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "memberId": 0, "totpCode": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/member/clear_member_totp" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "memberId": 0, "totpCode": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Admin Owner Or Admin Delete Own's' 2FA Device Source: https://docs.unibee.dev/api-reference/admin-member/admin-owner-or-admin-delete-owns-2fa-device post /merchant/member/delete_totp_device ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/member/delete_totp_device` Admin Owner Or Admin Delete Own's' 2FA Device *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------- | ------- | -------- | ----------------------- | | `deviceIdentity` | string | No | Device Identity | | `memberId` | integer | No | The unique id of member | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/member/delete_totp_device" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "deviceIdentity": "id_example", "memberId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/member/delete_totp_device" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "deviceIdentity": "id_example", "memberId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.deviceList` | array | The devices list' | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Clear Member OAuth Account Source: https://docs.unibee.dev/api-reference/admin-member/clear-member-oauth-account post /merchant/member/clear_oauth ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/member/clear_oauth` Clear Member OAuth Account *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------- | ------ | -------- | -------------- | | `provider` | string | Yes | OAuth provider | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/member/clear_oauth" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "provider": "id_example" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/member/clear_oauth" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "provider": "id_example" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Member List Source: https://docs.unibee.dev/api-reference/admin-member/get-member-list get /merchant/member/list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/member/list` Get Member List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ----------------- | ------- | -------- | --------------------------------------- | | `searchKey` | string | No | Search Key, FirstName,LastName or Email | | `email` | string | No | Search Filter Email | | `roleIds` | array | No | The member roleId if specified' | | `page` | integer | No | Page, Start With 0 | | `count` | integer | No | Count Of Page | | `createTimeStart` | integer | No | CreateTimeStart,UTC timestamp,seconds | | `createTimeEnd` | integer | No | CreateTimeEnd,UTC timestamp,seconds | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/member/list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/member/list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ---------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.merchantMembers` | array | Merchant Member Object List | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Member List Source: https://docs.unibee.dev/api-reference/admin-member/get-member-list-1 post /merchant/member/list ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/member/list` Get Member List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------------- | ------- | -------- | --------------------------------------- | | `count` | integer | No | Count Of Page | | `createTimeEnd` | integer | No | CreateTimeEnd,UTC timestamp,seconds | | `createTimeStart` | integer | No | CreateTimeStart,UTC timestamp,seconds | | `email` | string | No | Search Filter Email | | `page` | integer | No | Page, Start With 0 | | `roleIds` | array | No | The member roleId if specified' | | `searchKey` | string | No | Search Key, FirstName,LastName or Email | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/member/list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "count": 0, "createTimeEnd": 0, "createTimeStart": 0, "email": "user@example.com", "page": 0, "roleIds": [], "searchKey": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/member/list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "count": 0, "createTimeEnd": 0, "createTimeStart": 0, "email": "user@example.com", "page": 0, "roleIds": [], "searchKey": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ---------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.merchantMembers` | array | Merchant Member Object List | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Member Operation Log List Source: https://docs.unibee.dev/api-reference/admin-member/get-member-operation-log-list get /merchant/member/operation_log_list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/member/operation_log_list` Get Member Operation Log List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ----------------- | ------- | -------- | ------------------------------------- | | `memberFirstName` | string | No | Filter Member's FirstName Default All | | `memberLastName` | string | No | Filter Member's LastName, Default All | | `memberEmail` | string | No | Filter Member's Email, Default All | | `firstName` | string | No | FirstName | | `lastName` | string | No | LastName | | `email` | string | No | Email | | `subscriptionId` | string | No | subscription\_id | | `invoiceId` | string | No | invoice id | | `planId` | integer | No | plan id | | `discountCode` | string | No | discount\_code | | `page` | integer | No | Page, Start With 0 | | `count` | integer | No | Count Of Page | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/member/operation_log_list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/member/operation_log_list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ---------------------------- | ------- | ---------------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.merchantOperationLogs` | array | Merchant Member Operation Log List | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Member Profile Source: https://docs.unibee.dev/api-reference/admin-member/get-member-profile get /merchant/member/profile ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/member/profile` Get Member Profile *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/member/profile" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/member/profile" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.merchantMember` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Invite member Source: https://docs.unibee.dev/api-reference/admin-member/invite-member post /merchant/member/new_member Will send email to member email provided, member can enter admin portal by email otp login ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/member/new_member` Will send email to member email provided, member can enter admin portal by email otp login *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------- | ------ | -------- | ----------------------- | | `email` | string | Yes | The email of member | | `firstName` | string | No | The firstName of member | | `lastName` | string | No | The lastName of member | | `returnUrl` | string | No | Return url of member | | `roleIds` | array | Yes | The id list of role | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/member/new_member" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "firstName": "", "lastName": "", "returnUrl": "https://example.com", "roleIds": [] }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/member/new_member" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "firstName": "", "lastName": "", "returnUrl": "https://example.com", "roleIds": [] }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Logout Source: https://docs.unibee.dev/api-reference/admin-member/logout post /merchant/member/logout ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/member/logout` Logout *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/member/logout" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{}' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/member/logout" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{}' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Member Reset Password Source: https://docs.unibee.dev/api-reference/admin-member/member-reset-password post /merchant/member/passwordReset ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/member/passwordReset` Member Reset Password *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------- | ------ | -------- | -------------------------- | | `newPassword` | string | Yes | The new password of member | | `oldPassword` | string | Yes | The old password of member | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/member/passwordReset" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "newPassword": "", "oldPassword": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/member/passwordReset" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "newPassword": "", "oldPassword": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Resume Member Source: https://docs.unibee.dev/api-reference/admin-member/resume-member post /merchant/member/resume_member ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/member/resume_member` Resume Member *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------- | ------- | -------- | ----------------------- | | `memberId` | integer | No | The unique id of member | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/member/resume_member" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "memberId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/member/resume_member" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "memberId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Suspend Member Source: https://docs.unibee.dev/api-reference/admin-member/suspend-member post /merchant/member/suspend_member ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/member/suspend_member` Suspend Member *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------- | ------- | -------- | ----------------------- | | `memberId` | integer | No | The unique id of member | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/member/suspend_member" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "memberId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/member/suspend_member" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "memberId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Update Member OAuth Account Source: https://docs.unibee.dev/api-reference/admin-member/update-member-oauth-account post /merchant/member/update_oauth Pass OAuth token in request header (Auth.js JWT). Headers: X-Auth-JS-Token | X-Auth-Token | X-OAuth-Token ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/member/update_oauth` Pass OAuth token in request header (Auth.js JWT). Headers: X-Auth-JS-Token | X-Auth-Token | X-OAuth-Token *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/member/update_oauth" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{}' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/member/update_oauth" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{}' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Update Member Profile Source: https://docs.unibee.dev/api-reference/admin-member/update-member-profile post /merchant/member/update ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/member/update` Update Member Profile *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------- | ------ | -------- | ----------------------- | | `firstName` | string | No | The firstName of member | | `lastName` | string | No | The lastName of member | | `metadata` | object | No | Metadata,Map | | `mobile` | string | No | mobile | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/member/update" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "firstName": "", "lastName": "", "metadata": {}, "mobile": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/member/update" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "firstName": "", "lastName": "", "metadata": {}, "mobile": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.merchantMember` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Update Member Role Source: https://docs.unibee.dev/api-reference/admin-member/update-member-role post /merchant/member/update_member_role ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/member/update_member_role` Update Member Role *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------- | ------- | -------- | ----------------------- | | `memberId` | integer | No | The unique id of member | | `roleIds` | array | No | The id list of role | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/member/update_member_role" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "memberId": 0, "roleIds": [] }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/member/update_member_role" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "memberId": 0, "roleIds": [] }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Delete Role Source: https://docs.unibee.dev/api-reference/admin-role/delete-role post /merchant/role/delete ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/role/delete` Delete Role *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---- | ------- | -------- | ----------- | | `id` | integer | Yes | id | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/role/delete" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "id": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/role/delete" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "id": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Edit Role Source: https://docs.unibee.dev/api-reference/admin-role/edit-role post /merchant/role/edit ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/role/edit` Edit Role *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------- | ------- | -------- | ----------- | | `id` | integer | Yes | id | | `permissions` | array | Yes | Permissions | | `role` | string | Yes | Role | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/role/edit" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "id": 0, "permissions": [], "role": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/role/edit" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "id": 0, "permissions": [], "role": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Role List Source: https://docs.unibee.dev/api-reference/admin-role/get-role-list get /merchant/role/list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/role/list` Get Role List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/role/list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/role/list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.merchantRoles` | array | Merchant Roles | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # New Role Source: https://docs.unibee.dev/api-reference/admin-role/new-role post /merchant/role/new ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/role/new` New Role *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------- | ------ | -------- | ----------- | | `permissions` | array | Yes | Permissions | | `role` | string | Yes | Role | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/role/new" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "permissions": [], "role": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/role/new" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "permissions": [], "role": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Create Batch Discount Template Source: https://docs.unibee.dev/api-reference/batch-discount/create-batch-discount-template post /merchant/discount/batch/template/new Create a batch discount code template. Template must be activated before generating child codes. ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/discount/batch/template/new` Create a batch discount code template. Template must be activated before generating child codes. *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | --------------------- | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | | `advance` | boolean | No | AdvanceConfig, enable advanced configurations | | `billingType` | integer | Yes | The billing type of the discount code, 1-one-time, 2-recurring | | `codePrefix` | string | Yes | The unique code prefix for this batch template, will be used as template identifier and child code prefix, length 1-20 | | `currency` | string | No | The discount currency, available when discount\_type is fixed\_amount | | `cycleLimit` | integer | No | The count limitation of subscription cycle, 0-no limit | | `discountAmount` | integer | No | The discount amount, available when discount\_type is fixed\_amount | | `discountPercentage` | integer | No | The discount percentage, 100=1%, available when discount\_type is percentage | | `discountType` | integer | Yes | The discount type of the discount code, 1-percentage, 2-fixed\_amount | | `endTime` | integer | Yes | The end time of discount code can effect, utc timestamp in seconds | | `metadata` | object | No | Metadata, custom key-value pairs | | `name` | string | No | The batch template's display name | | `planApplyGroup` | string | No | | | `planApplyType` | integer | No | Plan apply type, 0-apply for all, 1-apply for plans specified, 2-exclude for plans specified, 3-Apply to Plans by Groups, 4-Apply to Plans except by Groups | | `planIds` | array | No | Ids of plan which discount code can effect | | `quantity` | integer | Yes | Target number of child codes to generate, max 10000 | | `startTime` | integer | Yes | The start time of discount code can effect, utc timestamp in seconds | | `subscriptionLimit` | integer | No | The limit of every subscription apply, 0-unlimited | | `upgradeLongPlanOnly` | boolean | No | AdvanceConfig, true-forbid for all except upgrade to longer plan | | `upgradeOnly` | boolean | No | AdvanceConfig, true-forbid for all except same interval upgrade action | | `userLimit` | integer | No | AdvanceConfig, The limit of every customer can apply, 0-unlimited | | `userScope` | integer | No | AdvanceConfig, Apply user scope, 0-for all, 1-for only new user, 2-for only renewals | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/discount/batch/template/new" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "advance": false, "billingType": 0, "codePrefix": "", "currency": "", "cycleLimit": 0, "discountAmount": 0, "discountPercentage": 0, "discountType": 0, "endTime": 0, "metadata": {}, "name": "", "planApplyGroup": "", "planApplyType": 0, "planIds": [], "quantity": 0, "startTime": 0, "subscriptionLimit": 0, "upgradeLongPlanOnly": false, "upgradeOnly": false, "userLimit": 0, "userScope": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/discount/batch/template/new" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "advance": false, "billingType": 0, "codePrefix": "", "currency": "", "cycleLimit": 0, "discountAmount": 0, "discountPercentage": 0, "discountType": 0, "endTime": 0, "metadata": {}, "name": "", "planApplyGroup": "", "planApplyType": 0, "planIds": [], "quantity": 0, "startTime": 0, "subscriptionLimit": 0, "upgradeLongPlanOnly": false, "upgradeOnly": false, "userLimit": 0, "userScope": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.template` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Edit Batch Discount Template Source: https://docs.unibee.dev/api-reference/batch-discount/edit-batch-discount-template post /merchant/discount/batch/template/edit Edit batch discount template. CodePrefix cannot be modified. Quantity can only be increased after activation. ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/discount/batch/template/edit` Edit batch discount template. CodePrefix cannot be modified. Quantity can only be increased after activation. *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | --------------------- | ------- | -------- | -------------------------------------------------------------------------------------- | | `advance` | boolean | No | AdvanceConfig, enable advanced configurations | | `billingType` | integer | No | The billing type, 1-one-time, 2-recurring | | `codePrefix` | string | Yes | The code prefix, must match existing value, cannot be modified | | `currency` | string | No | The discount currency | | `cycleLimit` | integer | No | The count limitation of subscription cycle, 0-no limit | | `discountAmount` | integer | No | The discount amount, available when discount\_type is fixed\_amount | | `discountPercentage` | integer | No | The discount percentage, 100=1% | | `discountType` | integer | No | The discount type, 1-percentage, 2-fixed\_amount | | `endTime` | integer | No | The end time, editable after activate, utc timestamp in seconds | | `id` | integer | Yes | The template's Id | | `metadata` | object | No | Metadata, custom key-value pairs | | `name` | string | No | The batch template's display name | | `planApplyGroup` | string | No | | | `planApplyType` | integer | No | Plan apply type, 0-apply for all, 1-specified, 2-exclude, 3-by groups, 4-except groups | | `planIds` | array | No | Ids of plan which discount code can effect | | `quantity` | integer | No | Target number of child codes, can only increase after activation, max 10000 | | `startTime` | integer | No | The start time, editable after activate, utc timestamp in seconds | | `subscriptionLimit` | integer | No | The limit of every subscription apply, 0-unlimited | | `upgradeLongPlanOnly` | boolean | No | AdvanceConfig, true-only for upgrade to longer plan | | `upgradeOnly` | boolean | No | AdvanceConfig, true-only for same interval upgrade | | `userLimit` | integer | No | AdvanceConfig, Per customer limit, 0-unlimited | | `userScope` | integer | No | AdvanceConfig, Apply user scope, 0-all, 1-new user, 2-renewals | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/discount/batch/template/edit" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "advance": false, "billingType": 0, "codePrefix": "", "currency": "", "cycleLimit": 0, "discountAmount": 0, "discountPercentage": 0, "discountType": 0, "endTime": 0, "id": 0, "metadata": {}, "name": "", "planApplyGroup": "", "planApplyType": 0, "planIds": [], "quantity": 0, "startTime": 0, "subscriptionLimit": 0, "upgradeLongPlanOnly": false, "upgradeOnly": false, "userLimit": 0, "userScope": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/discount/batch/template/edit" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "advance": false, "billingType": 0, "codePrefix": "", "currency": "", "cycleLimit": 0, "discountAmount": 0, "discountPercentage": 0, "discountType": 0, "endTime": 0, "id": 0, "metadata": {}, "name": "", "planApplyGroup": "", "planApplyType": 0, "planIds": [], "quantity": 0, "startTime": 0, "subscriptionLimit": 0, "upgradeLongPlanOnly": false, "upgradeOnly": false, "userLimit": 0, "userScope": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.template` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Generate Batch Child Codes Source: https://docs.unibee.dev/api-reference/batch-discount/generate-batch-child-codes post /merchant/discount/batch/children/generate Generate child codes for a batch template. Template must be in active status. Supports initial generation, retry on failure, and incremental expansion. Either templateId or templateCode must be provided. If quantity > 1000, isAsync must be set to true. Default is synchronous execution. ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/discount/batch/children/generate` Generate child codes for a batch template. Template must be in active status. Supports initial generation, retry on failure, and incremental expansion. Either templateId or templateCode must be provided. If quantity > 1000, isAsync must be set to true. Default is synchronous execution. *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | -------------- | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `codeLength` | integer | No | Optional. Total length of generated child code (prefix + random part). Must be > len(templateCode) and \< 190. The random part length must be sufficient to support the template's target quantity. | | `isAsync` | boolean | No | Force async execution. Default is false (synchronous). If quantity > 1000, this must be set to true. | | `quantity` | integer | No | Number of child codes to generate. If not provided, generates up to the template's quantity limit minus existing count. Must not exceed the remaining available quantity. | | `randomStyle` | string | No | Optional. Random part style: auto\|numeric\|lower\|upper. Default is auto, which infers style from templateCode: all digits -> numeric, all lowercase (with optional digits) -> lower, otherwise upper. | | `templateCode` | string | No | The template's code prefix (alternative to templateId) | | `templateId` | integer | No | The template's Id (alternative to templateCode) | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/discount/batch/children/generate" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "codeLength": 0, "isAsync": false, "quantity": 0, "randomStyle": "", "templateCode": "", "templateId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/discount/batch/children/generate" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "codeLength": 0, "isAsync": false, "quantity": 0, "randomStyle": "", "templateCode": "", "templateId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------------- | ------- | ------------------------------------------------------------------------------ | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.existingCount` | integer | Already generated count before this operation | | `data.failedCount` | integer | Failed count in this operation (only for synchronous execution) | | `data.generatedCount` | integer | Newly generated count in this operation (only for synchronous execution) | | `data.isAsync` | boolean | Whether the generation is running asynchronously | | `data.successCount` | integer | Successfully inserted count in this operation (only for synchronous execution) | | `data.templateCode` | string | Template code prefix | | `data.templateId` | integer | Template ID | | `data.totalTarget` | integer | Target total quantity | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Batch Child Code Detail Source: https://docs.unibee.dev/api-reference/batch-discount/get-batch-child-code-detail get /merchant/discount/batch/children/detail Get detail of a specific batch child code ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/discount/batch/children/detail` Get detail of a specific batch child code *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ---- | ------- | -------- | ------------------- | | `id` | integer | Yes | The child code's Id | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/discount/batch/children/detail" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/discount/batch/children/detail" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------ | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.child` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Batch Child Code Detail Source: https://docs.unibee.dev/api-reference/batch-discount/get-batch-child-code-detail-1 post /merchant/discount/batch/children/detail Get detail of a specific batch child code ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/discount/batch/children/detail` Get detail of a specific batch child code *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---- | ------- | -------- | ------------------- | | `id` | integer | Yes | The child code's Id | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/discount/batch/children/detail" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "id": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/discount/batch/children/detail" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "id": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------ | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.child` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Batch Child Codes List Source: https://docs.unibee.dev/api-reference/batch-discount/get-batch-child-codes-list get /merchant/discount/batch/children/list Get list of child codes for a specific batch template ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/discount/batch/children/list` Get list of child codes for a specific batch template *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ----------------- | ------- | -------- | --------------------------------------------------------- | | `templateId` | integer | Yes | The template's Id | | `code` | string | No | Filter by child code, fuzzy search | | `sortField` | string | No | Sort field, gmt\_create\|gmt\_modify, default gmt\_create | | `sortType` | string | No | Sort type, asc\|desc, default desc | | `page` | integer | No | Page number, start from 0 | | `count` | integer | No | Count per page | | `createTimeStart` | integer | No | Filter by create time start, UTC timestamp in seconds | | `createTimeEnd` | integer | No | Filter by create time end, UTC timestamp in seconds | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/discount/batch/children/list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/discount/batch/children/list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.children` | array | Child code list | | `data.total` | integer | Total count | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Batch Template Detail Source: https://docs.unibee.dev/api-reference/batch-discount/get-batch-template-detail get /merchant/discount/batch/template/detail Get batch discount template detail ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/discount/batch/template/detail` Get batch discount template detail *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ---- | ------- | -------- | ----------------- | | `id` | integer | Yes | The template's Id | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/discount/batch/template/detail" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/discount/batch/template/detail" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.template` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Batch Template Detail Source: https://docs.unibee.dev/api-reference/batch-discount/get-batch-template-detail-1 post /merchant/discount/batch/template/detail Get batch discount template detail ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/discount/batch/template/detail` Get batch discount template detail *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---- | ------- | -------- | ----------------- | | `id` | integer | Yes | The template's Id | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/discount/batch/template/detail" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "id": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/discount/batch/template/detail" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "id": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.template` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Batch Template List Source: https://docs.unibee.dev/api-reference/batch-discount/get-batch-template-list get /merchant/discount/batch/template/list Get batch discount template list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/discount/batch/template/list` Get batch discount template list *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ----------------- | ------- | -------- | ------------------------------------------------------------------------ | | `discountType` | array | No | Filter by discount\_type, 1-percentage, 2-fixed\_amount | | `billingType` | array | No | Filter by billing\_type, 1-one-time, 2-recurring | | `status` | array | No | Filter by status, 1-editable, 2-active, 3-deactive, 4-expire, 10-archive | | `codePrefix` | string | No | Filter by code prefix | | `searchKey` | string | No | Search by code prefix or name | | `currency` | string | No | Filter by currency | | `sortField` | string | No | Sort field, gmt\_create\|gmt\_modify, default gmt\_modify | | `sortType` | string | No | Sort type, asc\|desc, default desc | | `page` | integer | No | Page number, start from 0 | | `count` | integer | No | Count per page | | `createTimeStart` | integer | No | Filter by create time start, UTC timestamp in seconds | | `createTimeEnd` | integer | No | Filter by create time end, UTC timestamp in seconds | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/discount/batch/template/list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/discount/batch/template/list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------------------- | ------- | ---------------------------------------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.activeTemplateCount` | integer | Total count of active template codes | | `data.templates` | array | Batch template list | | `data.total` | integer | Total count | | `data.totalChildCodeCount` | integer | Total count of all child codes | | `data.usageRate` | number | Usage rate (usedChildCodeCount / totalChildCodeCount), 0-1 | | `data.usedChildCodeCount` | integer | Total count of used child codes | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Increment Template Quantity Source: https://docs.unibee.dev/api-reference/batch-discount/increment-template-quantity post /merchant/discount/batch/template/quantity_increment Increment batch template quantity. Template must be activated. Total quantity after increment must not exceed 10000. ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/discount/batch/template/quantity_increment` Increment batch template quantity. Template must be activated. Total quantity after increment must not exceed 10000. *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | -------- | ------- | -------- | ------------------------------------------------------- | | `amount` | integer | Yes | The quantity amount to increase, must be greater than 0 | | `id` | integer | Yes | The template's Id | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/discount/batch/template/quantity_increment" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "amount": 0, "id": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/discount/batch/template/quantity_increment" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "amount": 0, "id": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.template` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Archive Merchant Checkout Source: https://docs.unibee.dev/api-reference/checkout-setup/archive-merchant-checkout post /merchant/checkout/archive ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/checkout/archive` Archive Merchant Checkout *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------ | ------- | -------- | ----------- | | `checkoutId` | integer | Yes | checkout id | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/checkout/archive" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "checkoutId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/checkout/archive" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "checkoutId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Edit Merchant Checkout Source: https://docs.unibee.dev/api-reference/checkout-setup/edit-merchant-checkout post /merchant/checkout/edit_checkout ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/checkout/edit_checkout` Edit Merchant Checkout *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------- | ------- | -------- | ---------------------------- | | `checkoutId` | integer | Yes | checkout id | | `data` | object | No | checkout config data | | `description` | string | No | description | | `name` | string | No | name | | `stagingData` | object | No | checkout staging config data | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/checkout/edit_checkout" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "checkoutId": 0, "data": {}, "description": "", "name": "", "stagingData": {} }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/checkout/edit_checkout" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "checkoutId": 0, "data": {}, "description": "", "name": "", "stagingData": {} }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.merchantCheckout` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Merchant Checkout Detail Source: https://docs.unibee.dev/api-reference/checkout-setup/get-merchant-checkout-detail get /merchant/checkout/detail ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/checkout/detail` Get Merchant Checkout Detail *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ------------ | ------- | -------- | ----------- | | `checkoutId` | integer | Yes | checkout id | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/checkout/detail" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/checkout/detail" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.merchantCheckout` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Merchant Checkout Detail Source: https://docs.unibee.dev/api-reference/checkout-setup/get-merchant-checkout-detail-1 post /merchant/checkout/detail ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/checkout/detail` Get Merchant Checkout Detail *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------ | ------- | -------- | ----------- | | `checkoutId` | integer | Yes | checkout id | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/checkout/detail" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "checkoutId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/checkout/detail" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "checkoutId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.merchantCheckout` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Merchant Checkout Link Source: https://docs.unibee.dev/api-reference/checkout-setup/get-merchant-checkout-link get /merchant/checkout/get_link ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/checkout/get_link` Get Merchant Checkout Link *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ------------ | ------- | -------- | ----------- | | `checkoutId` | integer | Yes | checkout id | | `planId` | integer | Yes | | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/checkout/get_link" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/checkout/get_link" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.link` | string | Merchant Checkout Link | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Merchant Checkout Link Source: https://docs.unibee.dev/api-reference/checkout-setup/get-merchant-checkout-link-1 post /merchant/checkout/get_link ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/checkout/get_link` Get Merchant Checkout Link *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------ | ------- | -------- | ----------- | | `checkoutId` | integer | Yes | checkout id | | `planId` | integer | Yes | | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/checkout/get_link" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "checkoutId": 0, "planId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/checkout/get_link" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "checkoutId": 0, "planId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.link` | string | Merchant Checkout Link | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Merchant Checkout list Source: https://docs.unibee.dev/api-reference/checkout-setup/get-merchant-checkout-list get /merchant/checkout/list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/checkout/list` Get Merchant Checkout list *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ----------- | ------ | -------- | ------------------------------------- | | `SearchKey` | string | No | Search checkout id\|name\|description | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/checkout/list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/checkout/list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------------ | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.merchantCheckouts` | array | MerchantCheckout List Object | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Merchant Checkout list Source: https://docs.unibee.dev/api-reference/checkout-setup/get-merchant-checkout-list-1 post /merchant/checkout/list ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/checkout/list` Get Merchant Checkout list *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------- | ------ | -------- | ------------------------------------- | | `SearchKey` | string | No | Search checkout id\|name\|description | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/checkout/list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "SearchKey": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/checkout/list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "SearchKey": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------------ | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.merchantCheckouts` | array | MerchantCheckout List Object | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # New Merchant Checkout Source: https://docs.unibee.dev/api-reference/checkout-setup/new-merchant-checkout post /merchant/checkout/new_checkout ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/checkout/new_checkout` New Merchant Checkout *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------- | ------ | -------- | ---------------------------- | | `data` | object | No | checkout config data | | `description` | string | No | description | | `name` | string | No | name | | `stagingData` | object | No | checkout staging config data | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/checkout/new_checkout" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "data": {}, "description": "", "name": "", "stagingData": {} }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/checkout/new_checkout" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "data": {}, "description": "", "name": "", "stagingData": {} }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.merchantCheckout` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Credit Account Detail Source: https://docs.unibee.dev/api-reference/credit/credit-account-detail get /merchant/credit/detail ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/credit/detail` Credit Account Detail *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ---- | ------- | -------- | --------------------- | | `id` | integer | Yes | The credit account Id | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/credit/detail" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/credit/detail" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.creditAccount` | object | | | `data.creditTransactions` | array | Credit Transaction List | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Credit Account Detail Source: https://docs.unibee.dev/api-reference/credit/credit-account-detail-1 post /merchant/credit/detail ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/credit/detail` Credit Account Detail *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---- | ------- | -------- | --------------------- | | `id` | integer | Yes | The credit account Id | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/credit/detail" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "id": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/credit/detail" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "id": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.creditAccount` | object | | | `data.creditTransactions` | array | Credit Transaction List | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Edit Credit Config Source: https://docs.unibee.dev/api-reference/credit/edit-credit-config post /merchant/credit/edit_config ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/credit/edit_config` Edit Credit Config *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------------------- | ------- | -------- | ------------------------------------------------------------------------------------------------------------------ | | `currency` | string | Yes | currency | | `description` | string | No | description | | `discountCodeExclusive` | integer | No | discount code exclusive when purchase, default no, 0-no, 1-yes | | `exchangeRate` | integer | No | keep two decimal places,scale = 100, 1 currency = 1 credit \* (exchange\_rate/100), main account fixed rate to 100 | | `logo` | string | No | logo image base64, show when user purchase | | `logoUrl` | string | No | logo url, show when user purchase | | `metaData` | object | No | meta\_data(json) | | `name` | string | No | name | | `payoutEnable` | integer | No | credit account can payout or not, default no, 0-no, 1-yes | | `previewDefaultUsed` | integer | No | is default used when in purchase preview, default no, 0-no, 1-yes | | `rechargeEnable` | integer | No | credit account can recharge or not, default no, 0-no, 1-yes | | `recurring` | integer | No | apply to recurring, default no, 0-no,1-yes | | `type` | integer | Yes | type of credit account, 1-main account, 2-promo credit account | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/credit/edit_config" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "currency": "", "description": "", "discountCodeExclusive": 0, "exchangeRate": 0, "logo": "", "logoUrl": "https://example.com", "metaData": {}, "name": "", "payoutEnable": 0, "previewDefaultUsed": 0, "rechargeEnable": 0, "recurring": 0, "type": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/credit/edit_config" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "currency": "", "description": "", "discountCodeExclusive": 0, "exchangeRate": 0, "logo": "", "logoUrl": "https://example.com", "metaData": {}, "name": "", "payoutEnable": 0, "previewDefaultUsed": 0, "rechargeEnable": 0, "recurring": 0, "type": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.creditConfig` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Edit User Credit Account Config Source: https://docs.unibee.dev/api-reference/credit/edit-user-credit-account-config post /merchant/credit/edit_credit_account Edit User Credit Account Config ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/credit/edit_credit_account` Edit User Credit Account Config *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------- | ------- | -------- | ------------------------------------------------------------------------ | | `id` | integer | Yes | id of credit account | | `payoutEnable` | integer | No | credit account can used or payout\|apply in purchase or not, 0-no, 1-yes | | `rechargeEnable` | integer | No | credit account can be recharged\|increment or not, 0-no, 1-yes | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/credit/edit_credit_account" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "id": 0, "payoutEnable": 0, "rechargeEnable": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/credit/edit_credit_account" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "id": 0, "payoutEnable": 0, "rechargeEnable": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------------ | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.UserCreditAccount` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Credit Account List Source: https://docs.unibee.dev/api-reference/credit/get-credit-account-list get /merchant/credit/credit_account_list Get Credit Account list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/credit/credit_account_list` Get Credit Account list *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ----------------- | ------- | -------- | ------------------------------------------------------- | | `userId` | integer | No | filter id of user | | `email` | string | No | filter email of user | | `sortField` | string | No | Sort Field,gmt\_create\|gmt\_modify,Default gmt\_modify | | `sortType` | string | No | Sort Type,asc\|desc,Default desc | | `page` | integer | No | Page, Start 0 | | `count` | integer | No | Count Of Per Page | | `createTimeStart` | integer | No | CreateTimeStart,UTC timestamp,seconds | | `createTimeEnd` | integer | No | CreateTimeEnd,UTC timestamp,seconds | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/credit/credit_account_list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/credit/credit_account_list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.creditAccounts` | array | Credit Account List | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Credit Config list Source: https://docs.unibee.dev/api-reference/credit/get-credit-config-list get /merchant/credit/config_list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/credit/config_list` Get Credit Config list *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ---------- | ------ | -------- | ------------------------------------------------------------------- | | `types` | array | No | type list of credit account, 1-main account, 2-promo credit account | | `currency` | string | No | currency | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/credit/config_list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/credit/config_list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.creditConfigs` | array | CreditConfig List Object | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Credit Config list Source: https://docs.unibee.dev/api-reference/credit/get-credit-config-list-1 post /merchant/credit/config_list ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/credit/config_list` Get Credit Config list *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------- | ------ | -------- | ------------------------------------------------------------------- | | `currency` | string | No | currency | | `types` | array | No | type list of credit account, 1-main account, 2-promo credit account | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/credit/config_list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "currency": "", "types": [] }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/credit/config_list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "currency": "", "types": [] }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.creditConfigs` | array | CreditConfig List Object | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Credit Transaction List Source: https://docs.unibee.dev/api-reference/credit/get-credit-transaction-list get /merchant/credit/credit_transaction_list Get Credit Transaction list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/credit/credit_transaction_list` Get Credit Transaction list *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ------------------ | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | | `accountType` | integer | Yes | filter type of account, 1-main account, 2-promo credit account | | `userId` | integer | No | filter id of user | | `email` | string | No | filter email of user | | `currency` | string | No | filter currency of account | | `sortField` | string | No | Sort Field,gmt\_create\|gmt\_modify,Default gmt\_modify | | `sortType` | string | No | Sort Type,asc\|desc,Default desc | | `transactionTypes` | array | No | transaction type。1-recharge income,2-payment out,3-refund income,4-withdraw out,5-withdraw failed income, 6-admin change,7-recharge refund out | | `page` | integer | No | Page, Start 0 | | `count` | integer | No | Count Of Per Page | | `createTimeStart` | integer | No | CreateTimeStart,UTC timestamp,seconds | | `createTimeEnd` | integer | No | CreateTimeEnd,UTC timestamp,seconds | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/credit/credit_transaction_list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/credit/credit_transaction_list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.creditTransactions` | array | Credit Transaction List | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Credit Transaction List Source: https://docs.unibee.dev/api-reference/credit/get-credit-transaction-list-1 post /merchant/credit/credit_transaction_list Get Credit Transaction list ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/credit/credit_transaction_list` Get Credit Transaction list *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------------ | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | | `accountType` | integer | Yes | filter type of account, 1-main account, 2-promo credit account | | `count` | integer | No | Count Of Per Page | | `createTimeEnd` | integer | No | CreateTimeEnd,UTC timestamp,seconds | | `createTimeStart` | integer | No | CreateTimeStart,UTC timestamp,seconds | | `currency` | string | No | filter currency of account | | `email` | string | No | filter email of user | | `page` | integer | No | Page, Start 0 | | `sortField` | string | No | Sort Field,gmt\_create\|gmt\_modify,Default gmt\_modify | | `sortType` | string | No | Sort Type,asc\|desc,Default desc | | `transactionTypes` | array | No | transaction type。1-recharge income,2-payment out,3-refund income,4-withdraw out,5-withdraw failed income, 6-admin change,7-recharge refund out | | `userId` | integer | No | filter id of user | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/credit/credit_transaction_list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "accountType": 0, "count": 0, "createTimeEnd": 0, "createTimeStart": 0, "currency": "", "email": "user@example.com", "page": 0, "sortField": "", "sortType": "", "transactionTypes": [], "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/credit/credit_transaction_list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "accountType": 0, "count": 0, "createTimeEnd": 0, "createTimeStart": 0, "currency": "", "email": "user@example.com", "page": 0, "sortField": "", "sortType": "", "transactionTypes": [], "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.creditTransactions` | array | Credit Transaction List | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # New Credit Recharge Source: https://docs.unibee.dev/api-reference/credit/new-credit-recharge post /merchant/credit/new_credit_recharge New Credit Recharge ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/credit/new_credit_recharge` New Credit Recharge *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------------- | ------- | -------- | ------------------------------------------------------------------ | | `cancelUrl` | string | No | CancelUrl | | `creditAccountId` | integer | No | id of credit account, either userId\¤cy or creditAccountId | | `currency` | string | No | currency of recharge | | `description` | string | No | recharge description | | `gatewayId` | integer | Yes | | | `name` | string | No | recharge name | | `rechargeAmount` | integer | Yes | | | `returnUrl` | string | No | ReturnUrl | | `userId` | integer | No | id of user to recharge, either userId\¤cy or creditAccountId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/credit/new_credit_recharge" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "cancelUrl": "https://example.com", "creditAccountId": 0, "currency": "", "description": "", "gatewayId": 0, "name": "", "rechargeAmount": 0, "returnUrl": "https://example.com", "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/credit/new_credit_recharge" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "cancelUrl": "https://example.com", "creditAccountId": 0, "currency": "", "description": "", "gatewayId": 0, "name": "", "rechargeAmount": 0, "returnUrl": "https://example.com", "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.creditAccount` | object | | | `data.creditRecharge` | object | | | `data.gateway` | object | | | `data.invoice` | object | | | `data.link` | string | | | `data.merchant` | object | | | `data.paid` | boolean | Paid,true\|false | | `data.payment` | object | | | `data.user` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Setup Credit Config Source: https://docs.unibee.dev/api-reference/credit/setup-credit-config post /merchant/credit/new_config ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/credit/new_config` Setup Credit Config *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------------------- | ------- | -------- | ------------------------------------------------------------------------------------------------------------------ | | `currency` | string | Yes | currency | | `description` | string | No | description | | `discountCodeExclusive` | integer | No | discount code exclusive when purchase, default no, 0-no, 1-yes | | `exchangeRate` | integer | No | keep two decimal places,scale = 100, 1 currency = 1 credit \* (exchange\_rate/100), no effect on main account type | | `logo` | string | No | logo image base64, show when user purchase | | `logoUrl` | string | No | logo url, show when user purchase | | `metaData` | object | No | meta\_data(json) | | `name` | string | No | name | | `payoutEnable` | integer | No | credit account can used or payout in purchase or not, 0-no, 1-yes | | `previewDefaultUsed` | integer | No | is default used when in purchase preview, default no, 0-no, 1-yes | | `rechargeEnable` | integer | No | credit account can be recharged or not, 0-no, 1-yes | | `recurring` | integer | No | apply to recurring, default no, 0-no,1-yes | | `type` | integer | Yes | type of credit account, 1-main account, 2-promo credit account | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/credit/new_config" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "currency": "", "description": "", "discountCodeExclusive": 0, "exchangeRate": 0, "logo": "", "logoUrl": "https://example.com", "metaData": {}, "name": "", "payoutEnable": 0, "previewDefaultUsed": 0, "rechargeEnable": 0, "recurring": 0, "type": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/credit/new_config" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "currency": "", "description": "", "discountCodeExclusive": 0, "exchangeRate": 0, "logo": "", "logoUrl": "https://example.com", "metaData": {}, "name": "", "payoutEnable": 0, "previewDefaultUsed": 0, "rechargeEnable": 0, "recurring": 0, "type": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.creditConfig` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Activate Discount Code Source: https://docs.unibee.dev/api-reference/discount/activate-discount-code post /merchant/discount/activate Activate discount code, the discount code can only effect to payment or subscription after activated ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/discount/activate` Activate discount code, the discount code can only effect to payment or subscription after activated *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---- | ------- | -------- | ----------------- | | `id` | integer | Yes | The discount's Id | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/discount/activate" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "id": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/discount/activate" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "id": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Deactivate Discount Code Source: https://docs.unibee.dev/api-reference/discount/deactivate-discount-code post /merchant/discount/deactivate Deactivate discount code ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/discount/deactivate` Deactivate discount code *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---- | ------- | -------- | ----------------- | | `id` | integer | Yes | The discount's Id | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/discount/deactivate" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "id": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/discount/deactivate" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "id": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Delete Discount Code Source: https://docs.unibee.dev/api-reference/discount/delete-discount-code post /merchant/discount/delete Delete discount code before activate ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/discount/delete` Delete discount code before activate *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---- | ------- | -------- | ----------------- | | `id` | integer | Yes | The discount's Id | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/discount/delete" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "id": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/discount/delete" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "id": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Edit Discount Code Source: https://docs.unibee.dev/api-reference/discount/edit-discount-code post /merchant/discount/edit Edit the discount code before activate ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/discount/edit` Edit the discount code before activate *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | --------------------- | ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `advance` | boolean | No | AdvanceConfig, 0-false,1-true, will enable all advance config if set true | | `billingType` | integer | No | The billing type of the discount code, 1-one-time, 2-recurring, define the situation the code can be used, the code of one-time billing\_type can used for all situation that effect only once, the code of recurring billing\_tye can only used for subscription purchase | | `currency` | string | No | The discount currency of discount code, available when discount\_type is fixed\_amount | | `cycleLimit` | integer | No | The count limitation of subscription cycle,each subscription is valid separately, 0-no limit | | `discountAmount` | integer | No | The discount amount of the discount code, available when discount\_type is fixed\_amount | | `discountPercentage` | integer | No | The discount percentage of discount code, 100=1%, available when discount\_type is percentage | | `discountType` | integer | No | The discount type of the discount code, 1-percentage, 2-fixed\_amount, the discountType of code, the discountPercentage will be effect when discountType is percentage, the discountAmount and currency will be effect when discountTYpe is fixed\_amount | | `endTime` | integer | No | The end time of discount code can effect, editable after activate, utc time | | `id` | integer | Yes | The discount's Id | | `metadata` | object | No | Metadata,Map | | `name` | string | No | The discount's name | | `planApplyGroup` | string | No | | | `planApplyType` | integer | No | plan apply type, 0-apply for all, 1-apply for plans specified, 2-exclude for plans specified, 3-Apply to Plans by Groups(Billing Period Included), 4-Apply to Plans except by Groups(Billing Period Included) | | `planIds` | array | No | Ids of plan which discount code can effect, default effect all plans if not set | | `quantity` | integer | No | Quantity of code, default 0, set 0 to disable quantity management | | `startTime` | integer | No | The start time of discount code can effect, editable after activate, utc time | | `upgradeLongPlanOnly` | boolean | No | AdvanceConfig, true or false, will forbid for all except upgrade to longer plan if set true | | `upgradeOnly` | boolean | No | AdvanceConfig, true or false, will forbid for all except same interval upgrade action if set true | | `userLimit` | integer | No | AdvanceConfig, The limit of every customer can apply, the recurring apply not involved, 0-unlimited | | `userScope` | integer | No | AdvanceConfig, Apply user scope,0-for all, 1-for only new user, 2-for only renewals, renewals is upgrade\&downgrade\&renew | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/discount/edit" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "advance": false, "billingType": 0, "currency": "", "cycleLimit": 0, "discountAmount": 0, "discountPercentage": 0, "discountType": 0, "endTime": 0, "id": 0, "metadata": {}, "name": "", "planApplyGroup": "", "planApplyType": 0, "planIds": [], "quantity": 0, "startTime": 0, "upgradeLongPlanOnly": false, "upgradeOnly": false, "userLimit": 0, "userScope": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/discount/edit" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "advance": false, "billingType": 0, "currency": "", "cycleLimit": 0, "discountAmount": 0, "discountPercentage": 0, "discountType": 0, "endTime": 0, "id": 0, "metadata": {}, "name": "", "planApplyGroup": "", "planApplyType": 0, "planIds": [], "quantity": 0, "startTime": 0, "upgradeLongPlanOnly": false, "upgradeOnly": false, "userLimit": 0, "userScope": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.discount` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Discount Code List Source: https://docs.unibee.dev/api-reference/discount/get-discount-code-list get /merchant/discount/list Get discountCode list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/discount/list` Get discountCode list *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ----------------- | ------- | -------- | -------------------------------------------------------------- | | `discountType` | array | No | discount\_type, 1-percentage, 2-fixed\_amount | | `billingType` | array | No | billing\_type, 1-one-time, 2-recurring | | `status` | array | No | status, 1-editable, 2-active, 3-deactive, 4-expire, 10-archive | | `code` | string | No | Filter Code | | `searchKey` | string | No | Search Key, code or name | | `currency` | string | No | Filter Currency | | `sortField` | string | No | Sort Field,gmt\_create\|gmt\_modify,Default gmt\_modify | | `sortType` | string | No | Sort Type,asc\|desc,Default desc | | `page` | integer | No | Page, Start 0 | | `count` | integer | No | Count Of Per Page | | `createTimeStart` | integer | No | CreateTimeStart,UTC timestamp,seconds | | `createTimeEnd` | integer | No | CreateTimeEnd,UTC timestamp,seconds | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/discount/list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/discount/list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ---------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.discounts` | array | Discount Object List | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Merchant Discount Detail Source: https://docs.unibee.dev/api-reference/discount/get-merchant-discount-detail get /merchant/discount/detail ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/discount/detail` Get Merchant Discount Detail *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ---- | ------- | -------- | ----------------- | | `id` | integer | Yes | The discount's Id | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/discount/detail" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/discount/detail" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.discount` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Merchant Discount Detail Source: https://docs.unibee.dev/api-reference/discount/get-merchant-discount-detail-1 post /merchant/discount/detail ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/discount/detail` Get Merchant Discount Detail *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---- | ------- | -------- | ----------------- | | `id` | integer | Yes | The discount's Id | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/discount/detail" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "id": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/discount/detail" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "id": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.discount` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # New Discount Code Source: https://docs.unibee.dev/api-reference/discount/new-discount-code post /merchant/discount/new Create a new discount code, code can used in onetime or subscription purchase to make discount ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/discount/new` Create a new discount code, code can used in onetime or subscription purchase to make discount *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | --------------------- | ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `advance` | boolean | No | AdvanceConfig, 0-false,1-true, will enable all advance config if set true | | `billingType` | integer | Yes | The billing type of the discount code, 1-one-time, 2-recurring, define the situation the code can be used, the code of one-time billing\_type can used for all situation that effect only once, the code of recurring billing\_tye can only used for subscription purchase | | `code` | string | Yes | The discount's unique code, customize by merchant | | `currency` | string | No | The discount currency of discount code, available when discount\_type is fixed\_amount | | `cycleLimit` | integer | No | The count limitation of subscription cycle, each subscription is valid separately , 0-no limit | | `discountAmount` | integer | No | The discount amount of the discount code, available when discount\_type is fixed\_amount | | `discountPercentage` | integer | No | The discount percentage of discount code, 100=1%, available when discount\_type is percentage | | `discountType` | integer | Yes | The discount type of the discount code, 1-percentage, 2-fixed\_amount, the discountType of code, the discountPercentage will be effect when discountType is percentage, the discountAmount and currency will be effect when discountTYpe is fixed\_amount | | `endTime` | integer | Yes | The end time of discount code can effect, utc time | | `metadata` | object | No | Metadata,Map | | `name` | string | No | The discount's name | | `planApplyGroup` | string | No | | | `planApplyType` | integer | No | plan apply type, 0-apply for all, 1-apply for plans specified, 2-exclude for plans specified, 3-Apply to Plans by Groups(Billing Period Included), 4-Apply to Plans except by Groups(Billing Period Included) | | `planIds` | array | No | Ids of plan which discount code can effect, default effect all plans if not set | | `quantity` | integer | No | Quantity of code, default 0, set 0 to disable quantity management | | `startTime` | integer | Yes | The start time of discount code can effect, utc time | | `upgradeLongPlanOnly` | boolean | No | AdvanceConfig, true or false, will forbid for all except upgrade to longer plan if set true | | `upgradeOnly` | boolean | No | AdvanceConfig, true or false, will forbid for all except same interval upgrade action if set true | | `userLimit` | integer | No | AdvanceConfig, The limit of every customer can apply, the recurring apply not involved, 0-unlimited | | `userScope` | integer | No | AdvanceConfig, Apply user scope,0-for all, 1-for only new user, 2-for only renewals, renewals is upgrade\&downgrade\&renew | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/discount/new" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "advance": false, "billingType": 0, "code": "", "currency": "", "cycleLimit": 0, "discountAmount": 0, "discountPercentage": 0, "discountType": 0, "endTime": 0, "metadata": {}, "name": "", "planApplyGroup": "", "planApplyType": 0, "planIds": [], "quantity": 0, "startTime": 0, "upgradeLongPlanOnly": false, "upgradeOnly": false, "userLimit": 0, "userScope": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/discount/new" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "advance": false, "billingType": 0, "code": "", "currency": "", "cycleLimit": 0, "discountAmount": 0, "discountPercentage": 0, "discountType": 0, "endTime": 0, "metadata": {}, "name": "", "planApplyGroup": "", "planApplyType": 0, "planIds": [], "quantity": 0, "startTime": 0, "upgradeLongPlanOnly": false, "upgradeOnly": false, "userLimit": 0, "userScope": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.discount` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Quantity Decrement Source: https://docs.unibee.dev/api-reference/discount/quantity-decrement post /merchant/discount/decrease_quantity Decrease discount code quantity, the quantity after decreased should greater than 0, the action may disable quantity control if quantity decrease to 0 or lower than quantityUsed after decreased ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/discount/decrease_quantity` Decrease discount code quantity, the quantity after decreased should greater than 0, the action may disable quantity control if quantity decrease to 0 or lower than quantityUsed after decreased *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | -------- | ------- | -------- | --------------------------------------------------------------- | | `amount` | integer | No | The discount quantity Amount to decrease, should greater than 0 | | `id` | integer | Yes | The discount's Id | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/discount/decrease_quantity" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "amount": 0, "id": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/discount/decrease_quantity" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "amount": 0, "id": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.discountCode` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Quantity Increment Source: https://docs.unibee.dev/api-reference/discount/quantity-increment post /merchant/discount/quantity_increment Increase discount code quantity, if original quantity is 0, increase greater than 0 will enable quantity control ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/discount/quantity_increment` Increase discount code quantity, if original quantity is 0, increase greater than 0 will enable quantity control *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | -------- | ------- | -------- | --------------------------------------------------------------- | | `amount` | integer | No | The discount quantity amount to increase, should greater than 0 | | `id` | integer | Yes | The discount's Id | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/discount/quantity_increment" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "amount": 0, "id": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/discount/quantity_increment" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "amount": 0, "id": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.discountCode` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Activate Email Template Localization Version Source: https://docs.unibee.dev/api-reference/email-template/activate-email-template-localization-version post /merchant/email/template_activate_localization_version ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/email/template_activate_localization_version` Activate Email Template Localization Version *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | -------------- | ------ | -------- | --------------------------------- | | `templateName` | string | No | Template Name | | `versionId` | string | No | activate default if not specified | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/email/template_activate_localization_version" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "templateName": "", "versionId": "id_example" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/email/template_activate_localization_version" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "templateName": "", "versionId": "id_example" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Add Email Template Localization Version Source: https://docs.unibee.dev/api-reference/email-template/add-email-template-localization-version post /merchant/email/template_add_localization_version ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/email/template_add_localization_version` Add Email Template Localization Version *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | --------------- | ------ | -------- | ------------- | | `localizations` | array | No | | | `templateName` | string | No | Template Name | | `versionName` | string | No | Versioin Name | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/email/template_add_localization_version" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "localizations": [], "templateName": "", "versionName": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/email/template_add_localization_version" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "localizations": [], "templateName": "", "versionName": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.localizationVersion` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Customize Localization Template Sync Source: https://docs.unibee.dev/api-reference/email-template/customize-localization-template-sync post /merchant/email/custom_localization_template_sync Sync the custom localization email template to gateway (sendgrid) ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/email/custom_localization_template_sync` Sync the custom localization email template to gateway (sendgrid) *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | --------------- | ------- | -------- | ------------- | | `templateData` | array | Yes | TemplateData | | `versionEnable` | boolean | No | VersionEnable | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/email/custom_localization_template_sync" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "templateData": [], "versionEnable": false }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/email/custom_localization_template_sync" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "templateData": [], "versionEnable": false }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Delete Email Template Localization Version Source: https://docs.unibee.dev/api-reference/email-template/delete-email-template-localization-version post /merchant/email/template_delete_localization_version ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/email/template_delete_localization_version` Delete Email Template Localization Version *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | -------------- | ------ | -------- | ------------- | | `templateName` | string | No | Template Name | | `versionId` | string | No | | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/email/template_delete_localization_version" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "templateName": "", "versionId": "id_example" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/email/template_delete_localization_version" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "templateName": "", "versionId": "id_example" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Edit Email Template Localization Version Source: https://docs.unibee.dev/api-reference/email-template/edit-email-template-localization-version post /merchant/email/template_edit_localization_version ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/email/template_edit_localization_version` Edit Email Template Localization Version *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | --------------- | ------ | -------- | ------------- | | `localizations` | array | No | | | `templateName` | string | No | Template Name | | `versionId` | string | No | | | `versionName` | string | No | | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/email/template_edit_localization_version" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "localizations": [], "templateName": "", "versionId": "id_example", "versionName": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/email/template_edit_localization_version" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "localizations": [], "templateName": "", "versionId": "id_example", "versionName": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.localizationVersion` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Email Template List Source: https://docs.unibee.dev/api-reference/email-template/get-email-template-list get /merchant/email/template_list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/email/template_list` Get Email Template List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/email/template_list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/email/template_list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------------ | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.emailTemplateList` | array | Email Template Object List | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Test Email Template Localization Version Source: https://docs.unibee.dev/api-reference/email-template/test-email-template-localization-version post /merchant/email/template_test_localization_version ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/email/template_test_localization_version` Test Email Template Localization Version *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | -------------- | ------ | -------- | ------------- | | `email` | string | No | Email | | `language` | string | No | Language | | `templateName` | string | No | Template Name | | `versionId` | string | No | | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/email/template_test_localization_version" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "language": "", "templateName": "", "versionId": "id_example" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/email/template_test_localization_version" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "language": "", "templateName": "", "versionId": "id_example" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Email Gateway Set Default Source: https://docs.unibee.dev/api-reference/email/email-gateway-set-default post /merchant/email/gateway_set_default ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/email/gateway_set_default` Email Gateway Set Default *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------- | ------ | -------- | ------------------------------------------------------- | | `gatewayName` | string | Yes | The name of email gateway, available for sendgrid\|smtp | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/email/gateway_set_default" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "gatewayName": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/email/gateway_set_default" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "gatewayName": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Email Gateway Setup V2(Sendgrid|smtp) Source: https://docs.unibee.dev/api-reference/email/email-gateway-setup-v2sendgrid|smtp post /merchant/email/gateway_setup_v2 ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/email/gateway_setup_v2` Email Gateway Setup V2(Sendgrid|smtp) *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | --------------- | ------- | -------- | ------------------------------------------------------------- | | `IsDefault` | boolean | No | Whether setup the gateway as default or not, default is false | | `apiCredential` | string | No | | | `gatewayName` | string | Yes | The name of email gateway, available for sendgrid\|smtp | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/email/gateway_setup_v2" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "IsDefault": false, "apiCredential": "", "gatewayName": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/email/gateway_setup_v2" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "IsDefault": false, "apiCredential": "", "gatewayName": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Email Gateway Setup(Sendgrid) Source: https://docs.unibee.dev/api-reference/email/email-gateway-setupsendgrid post /merchant/email/gateway_setup ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/email/gateway_setup` Email Gateway Setup(Sendgrid) *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------- | ------- | -------- | ------------------------------------------------------------ | | `IsDefault` | boolean | No | Whether setup the gateway as default or not, default is true | | `data` | string | Yes | The setup data of email gateway | | `gatewayName` | string | Yes | The name of email gateway, available for sendgrid | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/email/gateway_setup" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "IsDefault": false, "data": "", "gatewayName": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/email/gateway_setup" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "IsDefault": false, "data": "", "gatewayName": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.data` | string | The hide star data | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Email Sender Setup Source: https://docs.unibee.dev/api-reference/email/email-sender-setup post /merchant/email/email_sender_setup ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/email/email_sender_setup` Email Sender Setup *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | --------- | ------ | -------- | ------------------------------------------------------------------------------------- | | `address` | string | Yes | The address of email sender, like '[no-reply@unibee.dev](mailto:no-reply@unibee.dev)' | | `name` | string | Yes | The name of email sender, like 'UniBee' | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/email/email_sender_setup" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "address": "", "name": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/email/email_sender_setup" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "address": "", "name": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Email History List Source: https://docs.unibee.dev/api-reference/email/get-email-history-list get /merchant/email/history_list Get email send history list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/email/history_list` Get email send history list *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ----------------- | ------- | -------- | ------------------------------------------------------- | | `searchKey` | string | No | Search Key, email or title | | `email` | string | No | Filter Email | | `status` | array | No | status, 0-pending, 1-success, 2-failure | | `sortField` | string | No | Sort Field,gmt\_create\|gmt\_modify,Default gmt\_modify | | `sortType` | string | No | Sort Type,asc\|desc,Default desc | | `page` | integer | No | Page, Start 0 | | `count` | integer | No | Count Of Per Page | | `createTimeStart` | integer | No | CreateTimeStart,UTC timestamp,seconds | | `createTimeEnd` | integer | No | CreateTimeEnd,UTC timestamp,seconds | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/email/history_list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/email/history_list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.emailHistories` | array | Email History Object List | | `data.emailHistoryStatistics` | object | | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Send Email To User Source: https://docs.unibee.dev/api-reference/email/send-email-to-user post /merchant/email/send_email_to_user ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/email/send_email_to_user` Send Email To User *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------------- | ------ | -------- | ------------------------------------------------------------------------------------------------ | | `attachInvoiceId` | string | No | AttachInvoiceId | | `content` | string | No | | | `email` | string | Yes | Email | | `gatewayName` | string | No | The name of email gateway, available for sendgrid\|smtp, default gateway will use if not provide | | `gatewayTemplateId` | string | No | GatewayTemplateId | | `language` | string | No | Language | | `subject` | string | No | | | `variables` | object | No | Variables,Map | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/email/send_email_to_user" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "attachInvoiceId": "id_example", "content": "", "email": "user@example.com", "gatewayName": "", "gatewayTemplateId": "id_example", "language": "", "subject": "", "variables": {} }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/email/send_email_to_user" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "attachInvoiceId": "id_example", "content": "", "email": "user@example.com", "gatewayName": "", "gatewayTemplateId": "id_example", "language": "", "subject": "", "variables": {} }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Send Email Via API Credential Source: https://docs.unibee.dev/api-reference/email/send-email-via-api-credential post /merchant/email/send_email_via_api_credential ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/email/send_email_via_api_credential` Send Email Via API Credential *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | --------------- | ------ | -------- | ------------------------------------------------------------------------------------------------ | | `apiCredential` | string | No | | | `content` | string | No | | | `email` | string | Yes | Email | | `gatewayName` | string | Yes | The name of email gateway, available for sendgrid\|smtp, default gateway will use if not provide | | `language` | string | No | Language | | `subject` | string | No | | | `variables` | object | No | Variables,Map | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/email/send_email_via_api_credential" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "apiCredential": "", "content": "", "email": "user@example.com", "gatewayName": "", "language": "", "subject": "", "variables": {} }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/email/send_email_via_api_credential" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "apiCredential": "", "content": "", "email": "user@example.com", "gatewayName": "", "language": "", "subject": "", "variables": {} }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Send Template Email To User Source: https://docs.unibee.dev/api-reference/email/send-template-email-to-user post /merchant/email/send_template_email_to_user ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/email/send_template_email_to_user` Send Template Email To User *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------------- | ------- | -------- | -------------------------- | | `attachInvoiceId` | string | No | AttachInvoiceId | | `templateName` | string | Yes | The name of email template | | `userId` | integer | Yes | UserId | | `variables` | object | No | Variables,Map | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/email/send_template_email_to_user" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "attachInvoiceId": "id_example", "templateName": "", "userId": 0, "variables": {} }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/email/send_template_email_to_user" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "attachInvoiceId": "id_example", "templateName": "", "userId": 0, "variables": {} }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Edit Payment Gateway Sort Source: https://docs.unibee.dev/api-reference/gateway/edit-payment-gateway-sort post /merchant/gateway/edit_sort ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/gateway/edit_sort` Edit Payment Gateway Sort *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | -------------- | ----- | -------- | ---------------------- | | `gatewaySorts` | array | No | structure gateway sort | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/gateway/edit_sort" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "gatewaySorts": [] }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/gateway/edit_sort" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "gatewaySorts": [] }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------- | ------- | --------------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.gateways` | array | Payment Gateway Setup Object List | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Exchange Rate Api Setup Source: https://docs.unibee.dev/api-reference/gateway/exchange-rate-api-setup post /merchant/gateway/setup_exchange_rate_api ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/gateway/setup_exchange_rate_api` Exchange Rate Api Setup *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | -------------------- | ------ | -------- | ---------------------------- | | `exchangeRateApiKey` | string | No | The key of exchange rate api | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/gateway/setup_exchange_rate_api" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "exchangeRateApiKey": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/gateway/setup_exchange_rate_api" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "exchangeRateApiKey": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------- | ------- | -------------------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.data` | string | The hide star key of exchange rate api | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Payment Gateway List Source: https://docs.unibee.dev/api-reference/gateway/get-payment-gateway-list get /merchant/gateway/list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/gateway/list` Get Payment Gateway List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | --------- | ------- | -------- | ------------------------------------------ | | `archive` | boolean | No | Filter archive gateway or not, default all | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/gateway/list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/gateway/list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.gateways` | array | Payment Gateway Object List | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Payment Gateway Setup List Source: https://docs.unibee.dev/api-reference/gateway/get-payment-gateway-setup-list get /merchant/gateway/setup_list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/gateway/setup_list` Get Payment Gateway Setup List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/gateway/setup_list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/gateway/setup_list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------- | ------- | --------------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.gateways` | array | Payment Gateway Setup Object List | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Payment Gateway Source: https://docs.unibee.dev/api-reference/gateway/payment-gateway get /merchant/gateway/detail Get Payment Gateway Detail ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/gateway/detail` Get Payment Gateway Detail *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ------------- | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `gatewayId` | integer | No | The id of payment gateway, either gatewayId or gatewayName should provided | | `gatewayName` | string | No | The specified name of payment gateway, either gatewayId or gatewayName should provided, stripe\|paypal\|changelly\|unitpay\|payssion\|cryptadium, return default gateway if provided | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/gateway/detail" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/gateway/detail" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.gateway` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Payment Gateway Source: https://docs.unibee.dev/api-reference/gateway/payment-gateway-1 post /merchant/gateway/detail Get Payment Gateway Detail ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/gateway/detail` Get Payment Gateway Detail *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------- | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `gatewayId` | integer | No | The id of payment gateway, either gatewayId or gatewayName should provided | | `gatewayName` | string | No | The specified name of payment gateway, either gatewayId or gatewayName should provided, stripe\|paypal\|changelly\|unitpay\|payssion\|cryptadium, return default gateway if provided | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/gateway/detail" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "gatewayId": 0, "gatewayName": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/gateway/detail" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "gatewayId": 0, "gatewayName": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.gateway` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Payment Gateway Archive Source: https://docs.unibee.dev/api-reference/gateway/payment-gateway-archive post /merchant/gateway/archive Archive the exist payment gateway,available for setup new one, the old user continue using the old gateway ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/gateway/archive` Archive the exist payment gateway,available for setup new one, the old user continue using the old gateway *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------- | ------- | -------- | ------------------------- | | `gatewayId` | integer | Yes | The id of payment gateway | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/gateway/archive" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "gatewayId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/gateway/archive" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "gatewayId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.gateway` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Payment Gateway Country Config Edit Source: https://docs.unibee.dev/api-reference/gateway/payment-gateway-country-config-edit post /merchant/gateway/edit_country_config Edit country config for payment gateway, to enable or disable the payment for countryCode, default is enable ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/gateway/edit_country_config` Edit country config for payment gateway, to enable or disable the payment for countryCode, default is enable *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | --------------- | ------- | -------- | ----------------------------------------------------------------------------------------------------- | | `countryConfig` | object | No | The country config of payment gateway, a map with countryCode as key, and value for enable or disable | | `gatewayId` | integer | Yes | The id of payment gateway | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/gateway/edit_country_config" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "countryConfig": {}, "gatewayId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/gateway/edit_country_config" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "countryConfig": {}, "gatewayId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Payment Gateway Edit Source: https://docs.unibee.dev/api-reference/gateway/payment-gateway-edit post /merchant/gateway/edit Edit the exist payment gateway ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/gateway/edit` Edit the exist payment gateway *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | --------------------- | ------- | -------- | ---------------------------------------------------------------------------------------------------- | | `companyIssuer` | string | No | | | `currencyExchange` | array | No | The currency exchange for gateway payment, effect at start of payment creation when currency matched | | `displayName` | string | No | The displayName of payment gateway | | `gatewayId` | integer | Yes | The id of payment gateway | | `gatewayKey` | string | No | The key of payment gateway | | `gatewayLogo` | array | No | The logo of payment gateway | | `gatewayPaymentTypes` | array | No | Selected gateway payment types | | `gatewaySecret` | string | No | The secret of payment gateway | | `metadata` | object | No | Metadata,Map | | `sort` | integer | No | The sort value of payment gateway, The higher the value, the lower the ranking | | `subGateway` | string | No | The sub gateway of payment gateway | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/gateway/edit" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "companyIssuer": "", "currencyExchange": [], "displayName": "", "gatewayId": 0, "gatewayKey": "", "gatewayLogo": [], "gatewayPaymentTypes": [], "gatewaySecret": "", "metadata": {}, "sort": 0, "subGateway": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/gateway/edit" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "companyIssuer": "", "currencyExchange": [], "displayName": "", "gatewayId": 0, "gatewayKey": "", "gatewayLogo": [], "gatewayPaymentTypes": [], "gatewaySecret": "", "metadata": {}, "sort": 0, "subGateway": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.gateway` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Payment Gateway Restore Source: https://docs.unibee.dev/api-reference/gateway/payment-gateway-restore post /merchant/gateway/restore Restore the exist payment gateway ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/gateway/restore` Restore the exist payment gateway *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------- | ------- | -------- | ------------------------- | | `gatewayId` | integer | Yes | The id of payment gateway | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/gateway/restore" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "gatewayId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/gateway/restore" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "gatewayId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.gateway` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Payment Gateway Set Default Source: https://docs.unibee.dev/api-reference/gateway/payment-gateway-set-default post /merchant/gateway/set_default Set default the exist payment gateway ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/gateway/set_default` Set default the exist payment gateway *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------- | ------- | -------- | ------------------------- | | `gatewayId` | integer | Yes | The id of payment gateway | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/gateway/set_default" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "gatewayId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/gateway/set_default" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "gatewayId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.gateway` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Payment Gateway Setup Source: https://docs.unibee.dev/api-reference/gateway/payment-gateway-setup post /merchant/gateway/setup Setup Payment gateway ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/gateway/setup` Setup Payment gateway *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | --------------------- | ------- | -------- | ---------------------------------------------------------------------------------------------------- | | `companyIssuer` | string | No | | | `currencyExchange` | array | No | The currency exchange for gateway payment, effect at start of payment creation when currency matched | | `displayName` | string | No | The displayName of payment gateway | | `gatewayIcons` | array | No | The icons of payment gateway | | `gatewayKey` | string | No | The key of payment gateway | | `gatewayName` | string | Yes | The name of payment gateway, stripe\|paypal\|changelly\|unitpay\|payssion\|cryptadium | | `gatewayPaymentTypes` | array | No | Selected gateway payment types | | `gatewaySecret` | string | No | The secret of payment gateway | | `metadata` | object | No | Metadata,Map | | `sort` | integer | No | The sort value of payment gateway, The higher the value, the lower the ranking | | `subGateway` | string | No | The sub gateway of payment gateway | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/gateway/setup" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "companyIssuer": "", "currencyExchange": [], "displayName": "", "gatewayIcons": [], "gatewayKey": "", "gatewayName": "", "gatewayPaymentTypes": [], "gatewaySecret": "", "metadata": {}, "sort": 0, "subGateway": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/gateway/setup" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "companyIssuer": "", "currencyExchange": [], "displayName": "", "gatewayIcons": [], "gatewayKey": "", "gatewayName": "", "gatewayPaymentTypes": [], "gatewaySecret": "", "metadata": {}, "sort": 0, "subGateway": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.gateway` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Payment Gateway Webhook Setup Source: https://docs.unibee.dev/api-reference/gateway/payment-gateway-webhook-setup post /merchant/gateway/setup_webhook ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/gateway/setup_webhook` Payment Gateway Webhook Setup *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | --------------- | ------- | -------- | ----------------------------- | | `gatewayId` | integer | Yes | The id of payment gateway | | `webhookSecret` | string | No | The secret of gateway webhook | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/gateway/setup_webhook" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "gatewayId": 0, "webhookSecret": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/gateway/setup_webhook" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "gatewayId": 0, "webhookSecret": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------------ | ------- | ------------------------------------------------------------------------------------------------------------------ | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.gatewayWebhookUrl` | string | The webhook endpoint url of payment gateway, if gateway is stripe, the url will setting to stripe by api automatic | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Segment Setup Source: https://docs.unibee.dev/api-reference/gateway/segment-setup post /merchant/track/setup_segment ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/track/setup_segment` Segment Setup *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------------ | ------ | -------- | ---------------- | | `serverSideSecret` | string | Yes | ServerSideSecret | | `userPortalSecret` | string | Yes | UserPortalSecret | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/track/setup_segment" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "serverSideSecret": "id_example", "userPortalSecret": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/track/setup_segment" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "serverSideSecret": "id_example", "userPortalSecret": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Wire Transfer Edit Source: https://docs.unibee.dev/api-reference/gateway/wire-transfer-edit post /merchant/gateway/wire_transfer_edit Edit the wire transfer ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/gateway/wire_transfer_edit` Edit the wire transfer *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | --------------- | ------- | -------- | ------------------------------------------------------------------------------ | | `bank` | string | No | | | `currency` | string | Yes | The currency of wire transfer | | `displayName` | string | No | The displayName of payment gateway | | `gatewayIcons` | array | No | The icons of payment gateway | | `gatewayId` | integer | Yes | The id of payment gateway | | `minimumAmount` | integer | Yes | The minimum amount of wire transfer, cents | | `sort` | integer | No | The sort value of payment gateway, The higher the value, the lower the ranking | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/gateway/wire_transfer_edit" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "bank": "", "currency": "", "displayName": "", "gatewayIcons": [], "gatewayId": 0, "minimumAmount": 0, "sort": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/gateway/wire_transfer_edit" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "bank": "", "currency": "", "displayName": "", "gatewayIcons": [], "gatewayId": 0, "minimumAmount": 0, "sort": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.gateway` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Wire Transfer Setup Source: https://docs.unibee.dev/api-reference/gateway/wire-transfer-setup post /merchant/gateway/wire_transfer_setup Setup the wire transfer ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/gateway/wire_transfer_setup` Setup the wire transfer *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | --------------- | ------- | -------- | ------------------------------------------------------------------------------ | | `bank` | string | No | | | `currency` | string | Yes | The currency of wire transfer | | `displayName` | string | No | The displayName of payment gateway | | `gatewayIcons` | array | No | The icons of payment gateway | | `minimumAmount` | integer | Yes | The minimum amount of wire transfer, cents | | `sort` | integer | No | The sort value of payment gateway, The higher the value, the lower the ranking | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/gateway/wire_transfer_setup" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "bank": "", "currency": "", "displayName": "", "gatewayIcons": [], "minimumAmount": 0, "sort": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/gateway/wire_transfer_setup" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "bank": "", "currency": "", "displayName": "", "gatewayIcons": [], "minimumAmount": 0, "sort": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.gateway` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Disconnection Quickbooks Source: https://docs.unibee.dev/api-reference/integrations/disconnection-quickbooks get /merchant/integration/quickbooks/disconnection ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/integration/quickbooks/disconnection` Disconnection Quickbooks *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/integration/quickbooks/disconnection" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/integration/quickbooks/disconnection" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Quickbooks Authorization Connection URL Source: https://docs.unibee.dev/api-reference/integrations/get-quickbooks-authorization-connection-url get /merchant/integration/quickbooks/get_authorization_url ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/integration/quickbooks/get_authorization_url` Get Quickbooks Authorization Connection URL *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ----------- | ------ | -------- | ----------- | | `returnUrl` | string | No | ReturnUrl | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/integration/quickbooks/get_authorization_url" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/integration/quickbooks/get_authorization_url" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.authorizationUrl` | string | Authorization URL | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Delete imported history invoice Source: https://docs.unibee.dev/api-reference/invoice-import/delete-imported-history-invoice post /merchant/invoice/history_invoice_import/delete Delete an imported history invoice (BizType=Import) and its related payment/refund if applicable. ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/invoice/history_invoice_import/delete` Delete an imported history invoice (BizType=Import) and its related payment/refund if applicable. *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------- | ------ | -------- | -------------------------------------- | | `invoiceId` | string | Yes | Required, imported InvoiceId to delete | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/invoice/history_invoice_import/delete" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceId": "id_example" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/invoice/history_invoice_import/delete" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceId": "id_example" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # History Invoice Import (supports override) Source: https://docs.unibee.dev/api-reference/invoice-import/history-invoice-import-supports-override post /merchant/invoice/history_invoice_import Each repetition import overrides existing invoices with matching InvoiceId (BizType=Import). ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/invoice/history_invoice_import` Each repetition import overrides existing invoices with matching InvoiceId (BizType=Import). *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | -------------------------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `countryCode` | string | No | Optional, ISO 3166-1 alpha-2 country code | | `createTime` | string | No | Optional, invoice create time '2006-01-02 15:04:05' (UTC) | | `currency` | string | Yes | Required, currency code (e.g. USD) | | `discountAmount` | integer | No | Optional, discount amount in cents | | `email` | string | No | User email, one of Email or ExternalUserId is required | | `externalUserId` | string | No | External user id, one of Email or ExternalUserId is required | | `gatewayId` | integer | No | Optional, gateway id. If 0 or omitted, invoice will be stored with gateway\_id=0. | | `invoiceId` | string | Yes | Required, external invoice id | | `invoiceName` | string | No | Optional, human readable invoice name (for display/search). If empty, system will use a generic name. | | `invoiceStatus` | string | No | Optional, paid\|failed\|cancelled, default paid if blank | | `lines` | array | No | Optional (API only), simplified invoice line items. If omitted or empty, system will automatically generate a single aggregated line from invoice-level amounts. | | `linkToLatestSubscription` | boolean | No | Optional, if true, link to user's latest active subscription in current merchant (ignores SubscriptionId). | | `metadata` | object | No | Optional, metadata map to be stored into invoice.meta\_data. | | `originalInvoiceId` | string | No | Required when totalAmount \< 0, original payment invoice's InvoiceId (of the payment invoice). | | `periodEnd` | string | No | Optional, period end '2006-01-02 15:04:05' (UTC) | | `periodStart` | string | No | Optional, period start '2006-01-02 15:04:05' (UTC) | | `productName` | string | No | Optional, product name shown on invoice. If empty, may fall back to InvoiceName. | | `subscriptionId` | string | No | Optional, subscription id. If provided, must belong to current user. | | `taxAmount` | integer | No | Optional, tax amount in cents | | `totalAmount` | integer | Yes | Required, total amount in cents, positive for payment, negative for refund | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/invoice/history_invoice_import" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "countryCode": "", "createTime": 0, "currency": "", "discountAmount": 0, "email": "user@example.com", "externalUserId": "id_example", "gatewayId": 0, "invoiceId": "id_example", "invoiceName": "", "invoiceStatus": "", "lines": [], "linkToLatestSubscription": false, "metadata": {}, "originalInvoiceId": "id_example", "periodEnd": "", "periodStart": "", "productName": "", "subscriptionId": "id_example", "taxAmount": 0, "totalAmount": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/invoice/history_invoice_import" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "countryCode": "", "createTime": 0, "currency": "", "discountAmount": 0, "email": "user@example.com", "externalUserId": "id_example", "gatewayId": 0, "invoiceId": "id_example", "invoiceName": "", "invoiceStatus": "", "lines": [], "linkToLatestSubscription": false, "metadata": {}, "originalInvoiceId": "id_example", "periodEnd": "", "periodStart": "", "productName": "", "subscriptionId": "id_example", "taxAmount": 0, "totalAmount": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.invoice` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # [Deprecated] Mark External Gateway Invoice As Paid Source: https://docs.unibee.dev/api-reference/invoice/[deprecated]-mark-external-gateway-invoice-as-paid post /merchant/invoice/external_gateway_invoice/mark_paid Deprecated. Please use payment-level external gateway APIs: /merchant/payment/external_gateway_payment/mark_paid. This invoice-level API is kept for compatibility only. ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/invoice/external_gateway_invoice/mark_paid` Deprecated. Please use payment-level external gateway APIs: /merchant/payment/external\_gateway\_payment/mark\_paid. This invoice-level API is kept for compatibility only. *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------------------- | ------- | -------- | --------------------------------------------------------------------------------- | | `externalTransactionId` | string | Yes | External payment transaction id from gateway, used as idempotent key | | `gatewayId` | integer | No | Optional. External gateway id; omit to use invoice's current gateway for auth | | `invoiceId` | string | Yes | Invoice id | | `metadata` | object | No | Additional metadata from external gateway | | `paidTime` | integer | No | Paid time, UTC timestamp in seconds (optional, default now) | | `signature` | string | Yes | HMAC-SHA256(gatewayKey, invoiceId\|externalTransactionId\|timestamp), hex-encoded | | `timestamp` | integer | Yes | Request timestamp, UTC seconds, used for expiry check | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/invoice/external_gateway_invoice/mark_paid" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalTransactionId": "id_example", "gatewayId": 0, "invoiceId": "id_example", "metadata": {}, "paidTime": 0, "signature": "", "timestamp": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/invoice/external_gateway_invoice/mark_paid" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalTransactionId": "id_example", "gatewayId": 0, "invoiceId": "id_example", "metadata": {}, "paidTime": 0, "signature": "", "timestamp": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.invoiceId` | string | Invoice id | | `data.paymentId` | string | Created or reused payment id | | `data.status` | string | Result status, e.g. success | | `data.subscriptionId` | string | Subscription id | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # [Deprecated] Mark External Gateway Invoice As Refunded Source: https://docs.unibee.dev/api-reference/invoice/[deprecated]-mark-external-gateway-invoice-as-refunded post /merchant/invoice/external_gateway_invoice/mark_refunded Deprecated placeholder. External refund flow will be redesigned. Do not use this invoice-level API for new integrations. ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/invoice/external_gateway_invoice/mark_refunded` Deprecated placeholder. External refund flow will be redesigned. Do not use this invoice-level API for new integrations. *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------------------- | ------- | -------- | ----------------------------------------------------------------------------- | | `externalTransactionId` | string | Yes | External refund transaction id from gateway | | `gatewayId` | integer | No | Optional. External gateway id; omit to use invoice's current gateway for auth | | `invoiceId` | string | Yes | Invoice id | | `signature` | string | Yes | HMAC-SHA256(gatewayKey, invoiceId\|externalTransactionId\|timestamp), hex | | `timestamp` | integer | Yes | Request timestamp, UTC seconds, used for expiry check | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/invoice/external_gateway_invoice/mark_refunded" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalTransactionId": "id_example", "gatewayId": 0, "invoiceId": "id_example", "signature": "", "timestamp": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/invoice/external_gateway_invoice/mark_refunded" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalTransactionId": "id_example", "gatewayId": 0, "invoiceId": "id_example", "signature": "", "timestamp": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ---------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.invoiceId` | string | Invoice id | | `data.refundId` | string | Created refund id | | `data.status` | string | Result status, e.g. success | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # [Deprecated] Update External Gateway Invoice Payment Link Source: https://docs.unibee.dev/api-reference/invoice/[deprecated]-update-external-gateway-invoice-payment-link post /merchant/invoice/external_gateway_invoice/update_payment_link Deprecated. Please use payment-level external gateway APIs: /merchant/payment/external_gateway_payment/update_link. This invoice-level API is kept for compatibility only. ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/invoice/external_gateway_invoice/update_payment_link` Deprecated. Please use payment-level external gateway APIs: /merchant/payment/external\_gateway\_payment/update\_link. This invoice-level API is kept for compatibility only. *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------------------- | ------- | -------- | ------------------------------------------------------------------------------- | | `externalTransactionId` | string | Yes | External payment transaction id from gateway (for linking) | | `gatewayId` | integer | No | Optional. External gateway id; omit to keep current gateway and use it for auth | | `invoiceId` | string | Yes | Invoice id | | `paymentLink` | string | Yes | External payment/checkout url shown to user in invoice | | `sendInvoice` | boolean | No | Whether to (re)send invoice email after payment link is updated | | `signature` | string | Yes | HMAC-SHA256(gatewayKey, invoiceId\|externalTransactionId\|timestamp), hex | | `timestamp` | integer | Yes | Request timestamp, UTC seconds, used for expiry check | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/invoice/external_gateway_invoice/update_payment_link" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalTransactionId": "id_example", "gatewayId": 0, "invoiceId": "id_example", "paymentLink": "", "sendInvoice": false, "signature": "", "timestamp": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/invoice/external_gateway_invoice/update_payment_link" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalTransactionId": "id_example", "gatewayId": 0, "invoiceId": "id_example", "paymentLink": "", "sendInvoice": false, "signature": "", "timestamp": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------ | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.invoiceId` | string | Invoice id | | `data.paymentLink` | string | Updated payment link | | `data.status` | string | Result status, e.g. success | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Admin Cancel Invoice Source: https://docs.unibee.dev/api-reference/invoice/admin-cancel-invoice post /merchant/invoice/cancel ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/invoice/cancel` Admin Cancel Invoice *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------- | ------ | -------- | ------------------------ | | `invoiceId` | string | Yes | The unique id of invoice | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/invoice/cancel" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceId": "id_example" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/invoice/cancel" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceId": "id_example" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Admin Clear Invoice Current Pending Payment Source: https://docs.unibee.dev/api-reference/invoice/admin-clear-invoice-current-pending-payment post /merchant/invoice/clearPayment ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/invoice/clearPayment` Admin Clear Invoice Current Pending Payment *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------- | ------ | -------- | ------------------------ | | `invoiceId` | string | Yes | The unique id of invoice | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/invoice/clearPayment" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceId": "id_example" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/invoice/clearPayment" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceId": "id_example" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Admin Reconvert Crypto Data and Send Invoice Email Source: https://docs.unibee.dev/api-reference/invoice/admin-reconvert-crypto-data-and-send-invoice-email post /merchant/invoice/reconvert_crypto_and_send_email ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/invoice/reconvert_crypto_and_send_email` Admin Reconvert Crypto Data and Send Invoice Email *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------- | ------ | -------- | ------------------------ | | `invoiceId` | string | Yes | The unique id of invoice | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/invoice/reconvert_crypto_and_send_email" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceId": "id_example" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/invoice/reconvert_crypto_and_send_email" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceId": "id_example" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Bulk CreditNote(Refund Invoice) Invoice List Source: https://docs.unibee.dev/api-reference/invoice/bulk-creditnoterefund-invoice-invoice-list post /merchant/invoice/credit_note/list Bulk credit note invoice list ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/invoice/credit_note/list` Bulk credit note invoice list *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------------- | ------- | -------- | ------------------------------------------------------------------------------------------------ | | `count` | integer | No | Count By Page | | `createTimeEnd` | integer | No | CreateTimeEnd,UTC timestamp,seconds | | `createTimeStart` | integer | No | CreateTimeStart,UTC timestamp,seconds | | `currency` | string | No | The currency of invoice | | `emails` | string | No | The email list of invoice user, split by commas or semicolons | | `file` | string | No | Email CSV File To Search | | `gatewayIds` | array | No | GatewayIds, Search Filter GatewayIds | | `page` | integer | No | Page, Start 0 | | `planIds` | array | No | PlanIds, Search Filter PlanIds | | `searchKey` | string | No | The search key of invoice | | `sortField` | string | No | Filter,em. invoice\_id\|gmt\_create\|gmt\_modify\|period\_end\|total\_amount,Default gmt\_modify | | `sortType` | string | No | Sort,asc\|desc,Default desc | | `status` | array | No | The status of invoice, 2-processing|3-paid \| 4-failed \| 5-cancelled | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/invoice/credit_note/list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "count": 0, "createTimeEnd": 0, "createTimeStart": 0, "currency": "", "emails": "user@example.com", "file": "", "gatewayIds": [], "page": 0, "planIds": [], "searchKey": "", "sortField": "", "sortType": "", "status": [] }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/invoice/credit_note/list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "count": 0, "createTimeEnd": 0, "createTimeStart": 0, "currency": "", "emails": "user@example.com", "file": "", "gatewayIds": [], "page": 0, "planIds": [], "searchKey": "", "sortField": "", "sortType": "", "status": [] }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------ | ------- | ----------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.creditNotes` | array | CreditNote Detail Object List | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Create And Mark Manual Refund (Crypto/WireTransfer/External) Source: https://docs.unibee.dev/api-reference/invoice/create-and-mark-manual-refund-cryptowiretransferexternal post /merchant/invoice/create_mark_refund Create a manual refund record for a paid invoice when refund has been processed offline via crypto, wire transfer or External gateway, and mark it as requested. Supports crypto, wire transfer and external invoices. ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/invoice/create_mark_refund` Create a manual refund record for a paid invoice when refund has been processed offline via crypto, wire transfer or External gateway, and mark it as requested. Supports crypto, wire transfer and external invoices. *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | -------------- | ------- | -------- | ----------------------------------------------------------- | | `invoiceId` | string | Yes | The unique id of invoice | | `reason` | string | Yes | The reason of refund | | `refundAmount` | integer | Yes | The amount of refund | | `refundNo` | string | No | The out refund number (idempotent key from external system) | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/invoice/create_mark_refund" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceId": "id_example", "reason": "", "refundAmount": 0, "refundNo": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/invoice/create_mark_refund" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceId": "id_example", "reason": "", "refundAmount": 0, "refundNo": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.refund` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Create InvoiceRefund Source: https://docs.unibee.dev/api-reference/invoice/create-invoicerefund post /merchant/invoice/refund Create payment refund for paid invoice ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/invoice/refund` Create payment refund for paid invoice *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | -------------- | ------- | -------- | ---------------------------------------------------------------------------------------------------- | | `invoiceId` | string | Yes | The unique id of invoice | | `paymentId` | string | No | The payment id to refund (required for split payment invoices, optional for single payment invoices) | | `reason` | string | Yes | The reason of refund | | `refundAmount` | integer | Yes | The amount of refund | | `refundNo` | string | No | The out refund number | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/invoice/refund" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceId": "id_example", "paymentId": "id_example", "reason": "", "refundAmount": 0, "refundNo": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/invoice/refund" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceId": "id_example", "paymentId": "id_example", "reason": "", "refundAmount": 0, "refundNo": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.refund` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Delete Pending Invoice Source: https://docs.unibee.dev/api-reference/invoice/delete-pending-invoice post /merchant/invoice/delete Delete invoice of pending status ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/invoice/delete` Delete invoice of pending status *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------- | ------ | -------- | ------------------------ | | `invoiceId` | string | Yes | The unique id of invoice | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/invoice/delete" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceId": "id_example" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/invoice/delete" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceId": "id_example" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Finish Invoice Source: https://docs.unibee.dev/api-reference/invoice/finish-invoice post /merchant/invoice/finish Finish invoice, generate invoice link ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/invoice/finish` Finish invoice, generate invoice link *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------- | ------- | -------- | -------------------------- | | `daysUtilDue` | integer | Yes | Due Day Of Invoice Payment | | `invoiceId` | string | Yes | The unique id of invoice | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/invoice/finish" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "daysUtilDue": 0, "invoiceId": "id_example" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/invoice/finish" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "daysUtilDue": 0, "invoiceId": "id_example" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.invoice` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Generate Invoice PDF Source: https://docs.unibee.dev/api-reference/invoice/generate-invoice-pdf post /merchant/invoice/pdf_generate ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/invoice/pdf_generate` Generate Invoice PDF *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | --------------- | ------- | -------- | ------------------------------------------------------ | | `invoiceId` | string | Yes | The unique id of invoice | | `sendUserEmail` | boolean | No | Whether sen invoice email to user or not,default false | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/invoice/pdf_generate" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceId": "id_example", "sendUserEmail": "user@example.com" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/invoice/pdf_generate" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceId": "id_example", "sendUserEmail": "user@example.com" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Invoice List Source: https://docs.unibee.dev/api-reference/invoice/get-invoice-list get /merchant/invoice/list Get invoice list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/invoice/list` Get invoice list *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ----------------- | ------- | -------- | ------------------------------------------------------------------------------------------------ | | `firstName` | string | No | The firstName of invoice | | `lastName` | string | No | The lastName of invoice | | `searchKey` | string | No | Search InvoiceName\|Email\|ProductName | | `currency` | string | No | The currency of invoice | | `status` | array | No | The status of invoice, 1-pending|2-processing|3-paid \| 4-failed \| 5-cancelled | | `amountStart` | integer | No | The filter start amount of invoice | | `amountEnd` | integer | No | The filter end amount of invoice | | `userId` | integer | No | The filter userid of invoice | | `gatewayIds` | array | No | GatewayIds, Search Filter GatewayIds | | `sendEmail` | string | No | The filter email of invoice | | `sortField` | string | No | Filter,em. invoice\_id\|gmt\_create\|gmt\_modify\|period\_end\|total\_amount,Default gmt\_modify | | `sortType` | string | No | Sort,asc\|desc,Default desc | | `deleteInclude` | boolean | No | Deleted Involved,Need Admin Permission | | `type` | integer | No | invoice Type, 0-payment, 1-refund | | `page` | integer | No | Page, Start 0 | | `count` | integer | No | Count By Page | | `createTimeStart` | integer | No | CreateTimeStart,UTC timestamp,seconds | | `createTimeEnd` | integer | No | CreateTimeEnd,UTC timestamp,seconds | | `reportTimeStart` | integer | No | ReportTimeStart,UTC timestamp,seconds | | `reportTimeEnd` | integer | No | ReportTimeEnd,UTC timestamp,seconds | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/invoice/list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/invoice/list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.invoices` | array | Invoice Detail Object List | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Invoice List Source: https://docs.unibee.dev/api-reference/invoice/get-invoice-list-1 post /merchant/invoice/list Get invoice list ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/invoice/list` Get invoice list *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------------- | ------- | -------- | ------------------------------------------------------------------------------------------------ | | `amountEnd` | integer | No | The filter end amount of invoice | | `amountStart` | integer | No | The filter start amount of invoice | | `count` | integer | No | Count By Page | | `createTimeEnd` | integer | No | CreateTimeEnd,UTC timestamp,seconds | | `createTimeStart` | integer | No | CreateTimeStart,UTC timestamp,seconds | | `currency` | string | No | The currency of invoice | | `deleteInclude` | boolean | No | Deleted Involved,Need Admin Permission | | `firstName` | string | No | The firstName of invoice | | `gatewayIds` | array | No | GatewayIds, Search Filter GatewayIds | | `lastName` | string | No | The lastName of invoice | | `page` | integer | No | Page, Start 0 | | `reportTimeEnd` | integer | No | ReportTimeEnd,UTC timestamp,seconds | | `reportTimeStart` | integer | No | ReportTimeStart,UTC timestamp,seconds | | `searchKey` | string | No | Search InvoiceName\|Email\|ProductName | | `sendEmail` | string | No | The filter email of invoice | | `sortField` | string | No | Filter,em. invoice\_id\|gmt\_create\|gmt\_modify\|period\_end\|total\_amount,Default gmt\_modify | | `sortType` | string | No | Sort,asc\|desc,Default desc | | `status` | array | No | The status of invoice, 1-pending|2-processing|3-paid \| 4-failed \| 5-cancelled | | `type` | integer | No | invoice Type, 0-payment, 1-refund | | `userId` | integer | No | The filter userid of invoice | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/invoice/list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "amountEnd": 0, "amountStart": 0, "count": 0, "createTimeEnd": 0, "createTimeStart": 0, "currency": "", "deleteInclude": false, "firstName": "", "gatewayIds": [], "lastName": "", "page": 0, "reportTimeEnd": 0, "reportTimeStart": 0, "searchKey": "", "sendEmail": "user@example.com", "sortField": "", "sortType": "", "status": [], "type": 0, "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/invoice/list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "amountEnd": 0, "amountStart": 0, "count": 0, "createTimeEnd": 0, "createTimeStart": 0, "currency": "", "deleteInclude": false, "firstName": "", "gatewayIds": [], "lastName": "", "page": 0, "reportTimeEnd": 0, "reportTimeStart": 0, "searchKey": "", "sendEmail": "user@example.com", "sortField": "", "sortType": "", "status": [], "type": 0, "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.invoices` | array | Invoice Detail Object List | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Split Payments Source: https://docs.unibee.dev/api-reference/invoice/get-split-payments get /merchant/invoice/split_payments Get all split payments for an invoice with payment statistics ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/invoice/split_payments` Get all split payments for an invoice with payment statistics *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ----------- | ------ | -------- | -------------- | | `invoiceId` | string | Yes | The invoice id | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/invoice/split_payments" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/invoice/split_payments" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ---------------------- | ------- | --------------------------------------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.paidAmount` | integer | Total paid amount from successful split payments in cents | | `data.payments` | array | List of split payments | | `data.remainingAmount` | integer | Remaining amount to be paid in cents | | `data.totalAmount` | integer | Total invoice amount in cents | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Split Payments Source: https://docs.unibee.dev/api-reference/invoice/get-split-payments-1 post /merchant/invoice/split_payments Get all split payments for an invoice with payment statistics ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/invoice/split_payments` Get all split payments for an invoice with payment statistics *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------- | ------ | -------- | -------------- | | `invoiceId` | string | Yes | The invoice id | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/invoice/split_payments" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceId": "id_example" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/invoice/split_payments" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceId": "id_example" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ---------------------- | ------- | --------------------------------------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.paidAmount` | integer | Total paid amount from successful split payments in cents | | `data.payments` | array | List of split payments | | `data.remainingAmount` | integer | Remaining amount to be paid in cents | | `data.totalAmount` | integer | Total invoice amount in cents | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Invoice Detail Source: https://docs.unibee.dev/api-reference/invoice/invoice-detail get /merchant/invoice/detail Get detail of invoice ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/invoice/detail` Get detail of invoice *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ----------- | ------ | -------- | ------------------------ | | `invoiceId` | string | Yes | The unique id of invoice | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/invoice/detail" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/invoice/detail" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------ | ------- | --------------------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.creditNotes` | array | CreditNotes Object List Link To Invoice | | `data.invoice` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Invoice Detail Source: https://docs.unibee.dev/api-reference/invoice/invoice-detail-1 post /merchant/invoice/detail Get detail of invoice ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/invoice/detail` Get detail of invoice *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------- | ------ | -------- | ------------------------ | | `invoiceId` | string | Yes | The unique id of invoice | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/invoice/detail" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceId": "id_example" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/invoice/detail" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceId": "id_example" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------ | ------- | --------------------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.creditNotes` | array | CreditNotes Object List Link To Invoice | | `data.invoice` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Invoice Edit Source: https://docs.unibee.dev/api-reference/invoice/invoice-edit post /merchant/invoice/edit Edit invoice of pending status ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/invoice/edit` Edit invoice of pending status *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------------------ | ------- | -------- | ------------------------------------------------ | | `applyPromoCredit` | boolean | No | Whether to apply promo credit | | `applyPromoCreditAmount` | integer | No | Specific promo credit amount to apply (optional) | | `currency` | string | No | The currency of invoice | | `finish` | boolean | No | | | `gatewayId` | integer | No | The gateway id of invoice | | `invoiceId` | string | Yes | The unique id of invoice | | `lines` | array | No | | | `name` | string | No | The name of invoice | | `taxPercentage` | integer | No | The tax percentage of invoice,1000=10% | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/invoice/edit" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "applyPromoCredit": false, "applyPromoCreditAmount": 0, "currency": "", "finish": false, "gatewayId": 0, "invoiceId": "id_example", "lines": [], "name": "", "taxPercentage": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/invoice/edit" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "applyPromoCredit": false, "applyPromoCreditAmount": 0, "currency": "", "finish": false, "gatewayId": 0, "invoiceId": "id_example", "lines": [], "name": "", "taxPercentage": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.invoice` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Mark Manual Invoice Refund As Success Source: https://docs.unibee.dev/api-reference/invoice/mark-manual-invoice-refund-as-success post /merchant/invoice/mark_refund_success Mark existing manual refund of an invoice as success, only supports Changelly (crypto) and Wire Transfer refunds. ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/invoice/mark_refund_success` Mark existing manual refund of an invoice as success, only supports Changelly (crypto) and Wire Transfer refunds. *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------- | ------ | -------- | ------------------------- | | `invoiceId` | string | Yes | The unique id of invoice | | `reason` | string | No | The reason of mark action | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/invoice/mark_refund_success" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceId": "id_example", "reason": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/invoice/mark_refund_success" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceId": "id_example", "reason": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Mark Wire Transfer Invoice As Paid (Manual) Source: https://docs.unibee.dev/api-reference/invoice/mark-wire-transfer-invoice-as-paid-manual post /merchant/invoice/mark_wire_transfer_success Manually mark a pending wire transfer invoice as paid and trigger invoice paid flow. Only supports wire transfer invoices that have been paid offline. ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/invoice/mark_wire_transfer_success` Manually mark a pending wire transfer invoice as paid and trigger invoice paid flow. Only supports wire transfer invoices that have been paid offline. *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------- | ------ | -------- | ------------------------------ | | `invoiceId` | string | Yes | The unique id of invoice | | `reason` | string | No | The reason of mark action | | `transferNumber` | string | Yes | The transfer number of invoice | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/invoice/mark_wire_transfer_success" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceId": "id_example", "reason": "", "transferNumber": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/invoice/mark_wire_transfer_success" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceId": "id_example", "reason": "", "transferNumber": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # New Invoice Source: https://docs.unibee.dev/api-reference/invoice/new-invoice post /merchant/invoice/new ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/invoice/new` New Invoice *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------------------ | ------- | -------- | ------------------------------------------------ | | `applyPromoCredit` | boolean | No | Whether to apply promo credit | | `applyPromoCreditAmount` | integer | No | Specific promo credit amount to apply (optional) | | `currency` | string | Yes | The currency of invoice | | `finish` | boolean | No | | | `gatewayId` | integer | No | The gateway id of invoice | | `lines` | array | No | | | `name` | string | No | The name of invoice | | `taxPercentage` | integer | Yes | The tax percentage of invoice,1000=10% | | `userId` | integer | Yes | The userId of invoice | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/invoice/new" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "applyPromoCredit": false, "applyPromoCreditAmount": 0, "currency": "", "finish": false, "gatewayId": 0, "lines": [], "name": "", "taxPercentage": 0, "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/invoice/new" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "applyPromoCredit": false, "applyPromoCreditAmount": 0, "currency": "", "finish": false, "gatewayId": 0, "lines": [], "name": "", "taxPercentage": 0, "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.invoice` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Send Invoice Email Source: https://docs.unibee.dev/api-reference/invoice/send-invoice-email post /merchant/invoice/send_email ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/invoice/send_email` Send Invoice Email *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------- | ------ | -------- | ------------------------ | | `invoiceId` | string | Yes | The unique id of invoice | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/invoice/send_email" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceId": "id_example" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/invoice/send_email" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceId": "id_example" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Sync Invoice User Snapshot With Latest User Info Source: https://docs.unibee.dev/api-reference/invoice/sync-invoice-user-snapshot-with-latest-user-info post /merchant/invoice/sync_user_snapshot Sync user snapshot in invoice with latest user profile ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/invoice/sync_user_snapshot` Sync user snapshot in invoice with latest user profile *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------- | ------ | -------- | ------------------------ | | `invoiceId` | string | Yes | The unique id of invoice | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/invoice/sync_user_snapshot" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceId": "id_example" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/invoice/sync_user_snapshot" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceId": "id_example" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.invoice` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Update Invoice PDF Source: https://docs.unibee.dev/api-reference/invoice/update-invoice-pdf post /merchant/invoice/pdf_update ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/invoice/pdf_update` Update Invoice PDF *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------------------------- | ------- | -------- | ------------------------------------------------------------------------------------------------------ | | `invoiceId` | string | Yes | The unique id of invoice | | `issueAddress` | string | No | IssueAddress | | `issueCompanyName` | string | No | IssueCompanyName | | `issueRegNumber` | string | No | IssueRegNumber | | `issueVatNumber` | string | No | IssueVatNumber | | `localizedCurrency` | string | No | LocalizedCurrency, To display localized currency amount | | `localizedExchangeRate` | number | No | LocalizedExchangeRate, exchange rate must set while LocalizedCurrency enabled | | `localizedExchangeRateDescription` | number | No | LocalizedExchangeRateDescription | | `metadata` | object | No | Metadata,Map | | `sendUserEmail` | boolean | No | Whether sen invoice email to user or not,default false | | `showDetailItem` | boolean | No | ShowDetailItem, whether to display detail item information in pdf generate, unitAmount, quantity, etc. | | `template` | string | No | Template | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/invoice/pdf_update" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceId": "id_example", "issueAddress": "", "issueCompanyName": "", "issueRegNumber": "", "issueVatNumber": "", "localizedCurrency": "", "localizedExchangeRate": "", "localizedExchangeRateDescription": "", "metadata": {}, "sendUserEmail": "user@example.com", "showDetailItem": false, "template": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/invoice/pdf_update" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceId": "id_example", "issueAddress": "", "issueCompanyName": "", "issueRegNumber": "", "issueVatNumber": "", "localizedCurrency": "", "localizedExchangeRate": "", "localizedExchangeRateDescription": "", "metadata": {}, "sendUserEmail": "user@example.com", "showDetailItem": false, "template": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # 2FA Password Forget Code Verification Source: https://docs.unibee.dev/api-reference/member-authentication/2fa-password-forget-code-verification post /merchant/auth/sso/passwordForgetTotpVerify Password forget 2FA process, verify 2FA code ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/auth/sso/passwordForgetTotpVerify` Password forget 2FA process, verify 2FA code *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------- | ------ | -------- | --------------------------------- | | `email` | string | Yes | The merchant member email address | | `newPassword` | string | Yes | The new password | | `totpCode` | string | Yes | The totp code | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/auth/sso/passwordForgetTotpVerify" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "newPassword": "", "totpCode": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/auth/sso/passwordForgetTotpVerify" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "newPassword": "", "totpCode": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Admin Member Clear Member 2FA Key With ResumeCode Source: https://docs.unibee.dev/api-reference/member-authentication/admin-member-clear-member-2fa-key-with-resumecode post /merchant/auth/sso/clear_totp ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/auth/sso/clear_totp` Admin Member Clear Member 2FA Key With ResumeCode *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------- | ------ | -------- | --------------------------------- | | `email` | string | Yes | The merchant member email address | | `totpResumeCode` | string | Yes | TOTP Resume Code | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/auth/sso/clear_totp" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "totpResumeCode": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/auth/sso/clear_totp" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "totpResumeCode": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Oauth Github Source: https://docs.unibee.dev/api-reference/member-authentication/get-oauth-github get /merchant/auth/sso/oauth/github Merchant Oauth Github ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/auth/sso/oauth/github` Merchant Oauth Github *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ------------ | ------ | -------- | ----------- | | `githubCode` | string | No | Github Code | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/auth/sso/oauth/github" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/auth/sso/oauth/github" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.sign` | string | Sign | | `data.userInfo` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Oauth Google Source: https://docs.unibee.dev/api-reference/member-authentication/get-oauth-google get /merchant/auth/sso/oauth/google Merchant Oauth Google ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/auth/sso/oauth/google` Merchant Oauth Google *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ------------- | ------ | -------- | ----------------------- | | `googleCode` | string | No | Google Code | | `redirectUri` | string | No | The Google Redirect Uri | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/auth/sso/oauth/google" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/auth/sso/oauth/google" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.sign` | string | Sign | | `data.userInfo` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Oauth Members Source: https://docs.unibee.dev/api-reference/member-authentication/get-oauth-members get /merchant/auth/sso/oauth/members Merchant Get Oauth Connected Members. Pass OAuth token in request header (Auth.js JWT). Headers: X-Auth-JS-Token | X-Auth-Token | X-OAuth-Token ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/auth/sso/oauth/members` Merchant Get Oauth Connected Members. Pass OAuth token in request header (Auth.js JWT). Headers: X-Auth-JS-Token | X-Auth-Token | X-OAuth-Token *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/auth/sso/oauth/members" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/auth/sso/oauth/members" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ---------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.merchantMembers` | array | Merchant Member Object List | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Merchant Password Login Source: https://docs.unibee.dev/api-reference/member-authentication/merchant-password-login post /merchant/auth/sso/login Merchant Password login ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/auth/sso/login` Merchant Password login *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------ | ------ | -------- | --------------------------------- | | `email` | string | Yes | The merchant member email address | | `password` | string | Yes | The merchant member password | | `provider` | string | No | Connect to OAuth provider | | `providerId` | string | No | Connect to OAuth ProviderId | | `totpCode` | string | No | The totp code | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/auth/sso/login" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "password": "", "provider": "id_example", "providerId": "id_example", "totpCode": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/auth/sso/login" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "password": "", "provider": "id_example", "providerId": "id_example", "totpCode": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.merchantMember` | object | | | `data.token` | string | Access token of admin portal | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # OAuth Login Source: https://docs.unibee.dev/api-reference/member-authentication/oauth-login post /merchant/auth/sso/oauth/login OAuth login. Pass OAuth token in request header (Auth.js JWT). Headers: X-Auth-JS-Token | X-Auth-Token | X-OAuth-Token ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/auth/sso/oauth/login` OAuth login. Pass OAuth token in request header (Auth.js JWT). Headers: X-Auth-JS-Token | X-Auth-Token | X-OAuth-Token *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------- | ------ | -------- | --------------------------------- | | `email` | string | Yes | The merchant member email address | | `totpCode` | string | No | The totp code | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/auth/sso/oauth/login" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "totpCode": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/auth/sso/oauth/login" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "totpCode": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.merchantMember` | object | | | `data.token` | string | Access token of admin portal | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # OAuth Setup Source: https://docs.unibee.dev/api-reference/member-authentication/oauth-setup post /merchant/auth/sso/oauth/setup Member OAuth Setup. Pass OAuth token in request header (Auth.js JWT). Headers: X-Auth-JS-Token | X-Auth-Token | X-OAuth-Token ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/auth/sso/oauth/setup` Member OAuth Setup. Pass OAuth token in request header (Auth.js JWT). Headers: X-Auth-JS-Token | X-Auth-Token | X-OAuth-Token *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------- | ------ | -------- | ---------------------------------------- | | `email` | string | Yes | The merchant member email address | | `newPassword` | string | No | The new password | | `setupToken` | string | Yes | The merchant member password setup token | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/auth/sso/oauth/setup" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "newPassword": "", "setupToken": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/auth/sso/oauth/setup" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "newPassword": "", "setupToken": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.merchantMember` | object | | | `data.token` | string | Access token of admin portal | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # OTP Login Source: https://docs.unibee.dev/api-reference/member-authentication/otp-login post /merchant/auth/sso/loginOTP Send email to member with OTP code ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/auth/sso/loginOTP` Send email to member with OTP code *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------- | ------ | -------- | --------------------------------- | | `email` | string | Yes | The merchant member email address | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/auth/sso/loginOTP" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/auth/sso/loginOTP" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # OTP Login Code Verification Source: https://docs.unibee.dev/api-reference/member-authentication/otp-login-code-verification post /merchant/auth/sso/loginOTPVerify OTP login for member, verify OTP code ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/auth/sso/loginOTPVerify` OTP login for member, verify OTP code *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------------ | ------ | -------- | --------------------------------- | | `email` | string | Yes | The merchant member email address | | `verificationCode` | string | Yes | OTP Code, received from email | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/auth/sso/loginOTPVerify" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "verificationCode": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/auth/sso/loginOTPVerify" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "verificationCode": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.merchantMember` | object | | | `data.token` | string | Access token of admin portal | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # OTP Password Forget Source: https://docs.unibee.dev/api-reference/member-authentication/otp-password-forget post /merchant/auth/sso/passwordForgetOTP Send email to member with OTP code ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/auth/sso/passwordForgetOTP` Send email to member with OTP code *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------- | ------ | -------- | --------------------------------- | | `email` | string | Yes | The merchant member email address | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/auth/sso/passwordForgetOTP" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/auth/sso/passwordForgetOTP" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # OTP Password Forget Code Verification Source: https://docs.unibee.dev/api-reference/member-authentication/otp-password-forget-code-verification post /merchant/auth/sso/passwordForgetOTPVerify Password forget OTP process, verify OTP code ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/auth/sso/passwordForgetOTPVerify` Password forget OTP process, verify OTP code *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------------ | ------ | -------- | --------------------------------- | | `email` | string | Yes | The merchant member email address | | `newPassword` | string | Yes | The new password | | `verificationCode` | string | Yes | OTP Code, received from email | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/auth/sso/passwordForgetOTPVerify" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "newPassword": "", "verificationCode": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/auth/sso/passwordForgetOTPVerify" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "newPassword": "", "verificationCode": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Password Setup Source: https://docs.unibee.dev/api-reference/member-authentication/password-setup post /merchant/auth/sso/passwordSetup Member Password Setup ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/auth/sso/passwordSetup` Member Password Setup *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------- | ------ | -------- | ---------------------------------------- | | `email` | string | Yes | The merchant member email address | | `newPassword` | string | Yes | The new password | | `setupToken` | string | Yes | The merchant member password setup token | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/auth/sso/passwordSetup" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "newPassword": "", "setupToken": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/auth/sso/passwordSetup" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "newPassword": "", "setupToken": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.merchantMember` | object | | | `data.token` | string | Access token of admin portal | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Register Source: https://docs.unibee.dev/api-reference/member-authentication/register post /merchant/auth/sso/register Register with owner permission, send email with OTP code ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/auth/sso/register` Register with owner permission, send email with OTP code *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------- | ------ | -------- | ---------------------------------- | | `companyName` | string | No | Company Name | | `countryCode` | string | No | Country Code | | `countryName` | string | No | Country Name | | `email` | string | Yes | The merchant owner's email address | | `firstName` | string | Yes | The merchant owner's first name | | `lastName` | string | Yes | The merchant owner's last name | | `metadata` | object | No | Metadata,Map | | `password` | string | Yes | The owner's password | | `phone` | string | No | The owner's Phone | | `userName` | string | No | The owner's UserName | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/auth/sso/register" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "companyName": "", "countryCode": "", "countryName": "", "email": "user@example.com", "firstName": "", "lastName": "", "metadata": {}, "password": "", "phone": "", "userName": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/auth/sso/register" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "companyName": "", "countryCode": "", "countryName": "", "email": "user@example.com", "firstName": "", "lastName": "", "metadata": {}, "password": "", "phone": "", "userName": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Register Email Check Source: https://docs.unibee.dev/api-reference/member-authentication/register-email-check post /merchant/auth/sso/register_email_check Check Register Email ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/auth/sso/register_email_check` Check Register Email *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------- | ------ | -------- | ---------------------------------- | | `email` | string | Yes | The merchant owner's email address | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/auth/sso/register_email_check" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/auth/sso/register_email_check" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------ | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.valid` | boolean | Valid | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Register OAuth Source: https://docs.unibee.dev/api-reference/member-authentication/register-oauth post /merchant/auth/sso/oauth/register Merchant OAuth Register. Pass OAuth token in request header (Auth.js JWT). Headers: X-Auth-JS-Token | X-Auth-Token | X-OAuth-Token ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/auth/sso/oauth/register` Merchant OAuth Register. Pass OAuth token in request header (Auth.js JWT). Headers: X-Auth-JS-Token | X-Auth-Token | X-OAuth-Token *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------- | ------ | -------- | --------------------------------- | | `companyName` | string | No | Company Name | | `countryCode` | string | No | Country Code | | `countryName` | string | No | Country Name | | `email` | string | Yes | The merchant member email address | | `firstName` | string | No | The merchant owner's first name | | `lastName` | string | No | The merchant owner's last name | | `metadata` | object | No | Metadata,Map | | `password` | string | No | The owner's password | | `phone` | string | No | The owner's Phone | | `userName` | string | No | The owner's UserName | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/auth/sso/oauth/register" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "companyName": "", "countryCode": "", "countryName": "", "email": "user@example.com", "firstName": "", "lastName": "", "metadata": {}, "password": "", "phone": "", "userName": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/auth/sso/oauth/register" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "companyName": "", "countryCode": "", "countryName": "", "email": "user@example.com", "firstName": "", "lastName": "", "metadata": {}, "password": "", "phone": "", "userName": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.merchantMember` | object | | | `data.token` | string | Access token of admin portal | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Register Verify Source: https://docs.unibee.dev/api-reference/member-authentication/register-verify post /merchant/auth/sso/registerVerify Merchant Register, verify OTP code ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/auth/sso/registerVerify` Merchant Register, verify OTP code *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------------ | ------ | -------- | --------------------------------- | | `email` | string | Yes | The merchant member email address | | `verificationCode` | string | Yes | OTP Code, received from email | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/auth/sso/registerVerify" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "verificationCode": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/auth/sso/registerVerify" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "verificationCode": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.merchantMember` | object | | | `data.token` | string | Access token of admin portal | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # RegisterWithoutCode Source: https://docs.unibee.dev/api-reference/member-authentication/registerwithoutcode post /merchant/auth/sso/register_without_verification Register with owner permission without code verification ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/auth/sso/register_without_verification` Register with owner permission without code verification *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------- | ------ | -------- | ---------------------------------- | | `companyName` | string | No | Company Name | | `countryCode` | string | No | Country Code | | `countryName` | string | No | Country Name | | `email` | string | Yes | The merchant owner's email address | | `firstName` | string | Yes | The merchant owner's first name | | `lastName` | string | Yes | The merchant owner's last name | | `metadata` | object | No | Metadata,Map | | `password` | string | Yes | The owner's password | | `phone` | string | No | The owner's Phone | | `userName` | string | No | The owner's UserName | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/auth/sso/register_without_verification" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "companyName": "", "countryCode": "", "countryName": "", "email": "user@example.com", "firstName": "", "lastName": "", "metadata": {}, "password": "", "phone": "", "userName": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/auth/sso/register_without_verification" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "companyName": "", "countryCode": "", "countryName": "", "email": "user@example.com", "firstName": "", "lastName": "", "metadata": {}, "password": "", "phone": "", "userName": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.merchantMember` | object | | | `data.token` | string | Access token of admin portal | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Session Login Source: https://docs.unibee.dev/api-reference/member-authentication/session-login post /merchant/auth/session_login Session login ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/auth/session_login` Session login *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | --------- | ------ | -------- | ----------- | | `session` | string | Yes | The session | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/auth/session_login" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "session": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/auth/session_login" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "session": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.merchantMember` | object | | | `data.return_url` | string | Return URL | | `data.token` | string | Access token of admin portal | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Admin Edit 2FA Config Source: https://docs.unibee.dev/api-reference/merchant/admin-edit-2fa-config post /merchant/edit_totp_config ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/edit_totp_config` Admin Edit 2FA Config *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------- | ------- | -------- | ----------------------------------------------------------------------------------------- | | `activate` | boolean | No | activate 2FA for all members, all members need 2FA while login if activate, otherwise not | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/edit_totp_config" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "activate": false }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/edit_totp_config" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "activate": false }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Amount Multi Currencies Exchange Source: https://docs.unibee.dev/api-reference/merchant/amount-multi-currencies-exchange post /merchant/amount_multi_currencies_exchange ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/amount_multi_currencies_exchange` Amount Multi Currencies Exchange *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------- | ------- | -------- | -------------------- | | `amount` | integer | Yes | Amount | | `currency` | string | Yes | The Default Currency | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/amount_multi_currencies_exchange" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "amount": 0, "currency": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/amount_multi_currencies_exchange" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "amount": 0, "currency": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.multiCurrencyConfigs` | array | Merchant's MultiCurrencies | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Edit Country Config Source: https://docs.unibee.dev/api-reference/merchant/edit-country-config post /merchant/country_config_list ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/country_config_list` Edit Country Config *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/country_config_list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{}' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/country_config_list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{}' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.configs` | array | Configs | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Generate New APIKey Source: https://docs.unibee.dev/api-reference/merchant/generate-new-apikey post /merchant/new_apikey Generate new apikey, The old one expired in one hour ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/new_apikey` Generate new apikey, The old one expired in one hour *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/new_apikey" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{}' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/new_apikey" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{}' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.apiKey` | string | ApiKey | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Country Config List Source: https://docs.unibee.dev/api-reference/merchant/get-country-config-list post /merchant/edit_country_config ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/edit_country_config` Get Country Config List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------- | ------- | -------- | ----------------------- | | `countryCode` | string | Yes | CountryCode | | `name` | string | No | name | | `vatEnable` | boolean | No | VatEnable, Default true | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/edit_country_config" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "countryCode": "", "name": "", "vatEnable": false }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/edit_country_config" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "countryCode": "", "name": "", "vatEnable": false }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get License Source: https://docs.unibee.dev/api-reference/merchant/get-license get /merchant/get_license ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/get_license` Get License *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/get_license" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/get_license" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.APIRateLimit` | integer | APIRateLimit | | `data.currentMemberCount` | integer | CurrentMemberCount | | `data.license` | object | | | `data.memberLimit` | integer | MemberLimit, -1=Unlimited | | `data.merchant` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get License Update Url Source: https://docs.unibee.dev/api-reference/merchant/get-license-update-url get /merchant/get_license_update_url ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/get_license_update_url` Get License Update Url *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ----------- | ------- | -------- | -------------------- | | `planId` | integer | No | Id of plan to update | | `returnUrl` | string | No | ReturnUrl | | `cancelUrl` | string | No | CancelUrl | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/get_license_update_url" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/get_license_update_url" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.url` | string | Url | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get License Update Url Source: https://docs.unibee.dev/api-reference/merchant/get-license-update-url-1 post /merchant/get_license_update_url ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/get_license_update_url` Get License Update Url *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------- | ------- | -------- | -------------------- | | `cancelUrl` | string | No | CancelUrl | | `planId` | integer | No | Id of plan to update | | `returnUrl` | string | No | ReturnUrl | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/get_license_update_url" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "cancelUrl": "https://example.com", "planId": 0, "returnUrl": "https://example.com" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/get_license_update_url" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "cancelUrl": "https://example.com", "planId": 0, "returnUrl": "https://example.com" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.url` | string | Url | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Merchant Overview Statistics Source: https://docs.unibee.dev/api-reference/merchant/get-merchant-overview-statistics get /merchant/overview_statistics ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/overview_statistics` Get Merchant Overview Statistics *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/overview_statistics" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/overview_statistics" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------------------ | ------- | ------------------------------------ | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.activePlansCount` | integer | Number of active plans | | `data.paymentSuccessRate` | number | Payment success rate, range 0.0\~1.0 | | `data.successfulPaymentsCount` | integer | Successful payments count | | `data.totalCustomersCount` | integer | Total customers count | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Profile Source: https://docs.unibee.dev/api-reference/merchant/get-profile get /merchant/get ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/get` Get Profile *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/get" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/get" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------------------------------- | ------- | ------------------------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.Currency` | array | Currency List | | `data.MemberRoles` | array | The member role list' | | `data.TimeZone` | array | TimeZone List | | `data.analyticsHost` | string | Analytics Host | | `data.cloudFeatureAnalyticsEnabled` | boolean | Analytics Feature Enabled For Cloud Version | | `data.cname` | string | CNAME value for merchant to configure | | `data.cnameDomain` | string | Merchant CNAME Domain | | `data.defaultCurrency` | string | Default Currency | | `data.defaultEmailGateway` | string | Default Email Gateway | | `data.emailGateways` | object | Email Gateway Map | | `data.emailSender` | object | | | `data.env` | string | System Env, em: daily\|stage\|local\|prod | | `data.exchangeRateApiKey` | string | ExchangeRateApiKey | | `data.gateways` | array | Gateway List | | `data.globalTOPTEnabled` | boolean | GlobalTOPTEnabled | | `data.globalUSVATConfig` | object | | | `data.isOwner` | boolean | Check Member is Owner | | `data.isProd` | boolean | Check System Env Is Prod, true\|false | | `data.merchant` | object | | | `data.merchantMember` | object | | | `data.multiCurrencyConfigs` | array | Merchant's MultiCurrency Configs | | `data.openApiHost` | string | OpenApi Host | | `data.openApiKey` | string | OpenAPIKey | | `data.quickBooksCompanyName` | string | QuickBooksCompanyName | | `data.quickBooksLastSyncError` | string | QuickBooksLastSyncError | | `data.quickBooksLastSynchronized` | string | QuickBooksLastSynchronized | | `data.segmentServerSideKey` | string | SegmentServerSideKey | | `data.segmentUserPortalKey` | string | SegmentUserPortalKey | | `data.sendGridKey` | string | SendGridKey | | `data.taxJarApiKeys` | object | | | `data.vatSenseKey` | string | VatSenseKey | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Multi Currencies Setup Source: https://docs.unibee.dev/api-reference/merchant/multi-currencies-setup post /merchant/setup_multi_currencies ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/setup_multi_currencies` Multi Currencies Setup *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------------- | ----- | -------- | -------------------------- | | `multiCurrencyConfigs` | array | No | Merchant's MultiCurrencies | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/setup_multi_currencies" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "multiCurrencyConfigs": [] }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/setup_multi_currencies" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "multiCurrencyConfigs": [] }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.multiCurrencyConfigs` | array | Merchant's MultiCurrencies | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Update Merchant CNAME Domain Source: https://docs.unibee.dev/api-reference/merchant/update-merchant-cname-domain post /merchant/update_cname_domain ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/update_cname_domain` Update Merchant CNAME Domain *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | -------- | ------ | -------- | ------------ | | `domain` | string | Yes | CNAME domain | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/update_cname_domain" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "domain": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/update_cname_domain" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "domain": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Update Profile Source: https://docs.unibee.dev/api-reference/merchant/update-profile post /merchant/update ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/update` Update Profile *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | --------------------- | ------ | -------- | --------------------- | | `address` | string | No | address | | `companyLogo` | string | No | company\_logo | | `companyName` | string | No | company\_name | | `companyRegistryCode` | string | No | Country Registry Code | | `companyVatNumber` | string | No | Country Vat Number | | `countryCode` | string | No | Country Code | | `countryName` | string | No | Country Name | | `email` | string | No | email | | `phone` | string | No | phone | | `timeZone` | string | No | User TimeZone | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/update" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "address": "", "companyLogo": "", "companyName": "", "companyRegistryCode": "", "companyVatNumber": "", "countryCode": "", "countryName": "", "email": "user@example.com", "phone": "", "timeZone": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/update" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "address": "", "companyLogo": "", "companyName": "", "companyRegistryCode": "", "companyVatNumber": "", "countryCode": "", "countryName": "", "email": "user@example.com", "phone": "", "timeZone": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.merchant` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Update Profile Portal Host Domain Source: https://docs.unibee.dev/api-reference/merchant/update-profile-portal-host-domain post /merchant/update_portal_host_domain ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/update_portal_host_domain` Update Profile Portal Host Domain *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | -------- | ------ | -------- | ----------- | | `domain` | string | Yes | domain | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/update_portal_host_domain" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "domain": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/update_portal_host_domain" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "domain": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Del Merchant Metric Event Source: https://docs.unibee.dev/api-reference/metric-event/del-merchant-metric-event post /merchant/metric/event/delete ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/metric/event/delete` Del Merchant Metric Event *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------------- | ------- | -------- | ------------------------------------------------------------------------------ | | `email` | string | No | Email, UserId,ExternalUserId, or Email provides one of three options | | `externalEventId` | string | Yes | ExternalEventId | | `externalUserId` | string | No | ExternalUserId, UserId, ExternalUserId, or Email provides one of three options | | `metricCode` | string | Yes | MetricCode | | `userId` | integer | No | UserId, UserId,ExternalUserId, or Email provides one of three options | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/metric/event/delete" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "externalEventId": "id_example", "externalUserId": "id_example", "metricCode": "", "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/metric/event/delete" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "externalEventId": "id_example", "externalUserId": "id_example", "metricCode": "", "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Merchant Metric Event Current Value Source: https://docs.unibee.dev/api-reference/metric-event/get-merchant-metric-event-current-value post /merchant/metric/event/current_value ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/metric/event/current_value` Get Merchant Metric Event Current Value *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------- | ------- | -------- | ---------------------------------------------------------------------------------------------- | | `email` | string | No | Email, UserId, ExternalUserId, or Email provides one of three options | | `externalUserId` | string | No | ExternalUserId, UserId, ExternalUserId, or Email provides one of three options | | `metricCode` | string | Yes | MetricCode | | `productId` | integer | No | Id of product. Default product will use if productId not specified and subscriptionId is blank | | `userId` | integer | No | UserId, UserId, ExternalUserId, or Email provides one of three options | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/metric/event/current_value" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "externalUserId": "id_example", "metricCode": "", "productId": 0, "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/metric/event/current_value" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "externalUserId": "id_example", "metricCode": "", "productId": 0, "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------- | ------- | ------------------------------------------------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.currentValue` | integer | | | `data.metricLimit` | object | | | `data.totalLimit` | integer | Total limit for the metric. Returns -1 if metric is not limit type. | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Metric Event List Source: https://docs.unibee.dev/api-reference/metric-event/metric-event-list get /merchant/metric/event_list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/metric/event_list` Metric Event List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ----------------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `userIds` | array | No | Filter UserIds, Default All | | `metricIds` | array | No | Filter MetricIds, Default All | | `subscriptionIds` | array | No | Filter SubscriptionIds, Default All | | `sortField` | string | No | Sort,user\_id\|gmt\_create,Default gmt\_create | | `sortType` | string | No | Sort Type,asc\|desc,Default desc | | `page` | integer | No | Page,Start 0 | | `count` | integer | No | Count OF Page | | `createTimeStart` | integer | No | CreateTimeStart,UTC timestamp,seconds | | `createTimeEnd` | integer | No | CreateTimeEnd,UTC timestamp,seconds | | `invoiceId` | string | No | When set, list events for this invoice period (match subscription\_period\_start/end with invoice PeriodStart/PeriodEnd); overrides CreateTimeStart/CreateTimeEnd for period scope | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/metric/event_list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/metric/event_list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.events` | array | User Metric Event List | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Metric Event List Source: https://docs.unibee.dev/api-reference/metric-event/metric-event-list-1 post /merchant/metric/event_list ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/metric/event_list` Metric Event List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `count` | integer | No | Count OF Page | | `createTimeEnd` | integer | No | CreateTimeEnd,UTC timestamp,seconds | | `createTimeStart` | integer | No | CreateTimeStart,UTC timestamp,seconds | | `invoiceId` | string | No | When set, list events for this invoice period (match subscription\_period\_start/end with invoice PeriodStart/PeriodEnd); overrides CreateTimeStart/CreateTimeEnd for period scope | | `metricIds` | array | No | Filter MetricIds, Default All | | `page` | integer | No | Page,Start 0 | | `sortField` | string | No | Sort,user\_id\|gmt\_create,Default gmt\_create | | `sortType` | string | No | Sort Type,asc\|desc,Default desc | | `subscriptionIds` | array | No | Filter SubscriptionIds, Default All | | `userIds` | array | No | Filter UserIds, Default All | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/metric/event_list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "count": 0, "createTimeEnd": 0, "createTimeStart": 0, "invoiceId": "id_example", "metricIds": [], "page": 0, "sortField": "", "sortType": "", "subscriptionIds": [], "userIds": [] }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/metric/event_list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "count": 0, "createTimeEnd": 0, "createTimeStart": 0, "invoiceId": "id_example", "metricIds": [], "page": 0, "sortField": "", "sortType": "", "subscriptionIds": [], "userIds": [] }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.events` | array | User Metric Event List | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # New Merchant Metric Event Source: https://docs.unibee.dev/api-reference/metric-event/new-merchant-metric-event post /merchant/metric/event/new ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/metric/event/new` New Merchant Metric Event *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | --------------------- | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `aggregationUniqueId` | string | No | AggregationUniqueId, valid when AggregationType is count unique. If provided, it has higher priority and will override the value in MetricProperties for the AggregationProperty field | | `aggregationValue` | integer | No | AggregationValue, valid when AggregationType is latest, max or sum. If provided, it has higher priority and will override the value in MetricProperties for the AggregationProperty field | | `email` | string | No | Email, UserId, ExternalUserId, or Email provides one of three options | | `externalEventId` | string | Yes | ExternalEventId, **unique** | | `externalUserId` | string | No | ExternalUserId, UserId, ExternalUserId, or Email provides one of three options | | `metricCode` | string | Yes | MetricCode | | `metricProperties` | string | No | | | `productId` | integer | No | Id of product. Default product will use if productId not specified and subscriptionId is blank | | `userId` | integer | No | UserId, UserId, ExternalUserId, or Email provides one of three options | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/metric/event/new" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "aggregationUniqueId": "id_example", "aggregationValue": 0, "email": "user@example.com", "externalEventId": "id_example", "externalUserId": "id_example", "metricCode": "", "metricProperties": "", "productId": 0, "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/metric/event/new" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "aggregationUniqueId": "id_example", "aggregationValue": 0, "email": "user@example.com", "externalEventId": "id_example", "externalUserId": "id_example", "metricCode": "", "metricProperties": "", "productId": 0, "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.merchantMetricEvent` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Manual Adjust Metric Limit Source: https://docs.unibee.dev/api-reference/metric-limit-quota/manual-adjust-metric-limit post /merchant/metric/limit_adjust ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/metric/limit_adjust` Manual Adjust Metric Limit *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------- | ------- | -------- | --------------------------------------------------------------------------- | | `amount` | integer | Yes | Adjustment amount (positive to increase, negative to decrease, cannot be 0) | | `metricCode` | string | Yes | Metric Code | | `productId` | integer | No | Product ID, default 0 for default product | | `reason` | string | Yes | Reason for adjustment | | `subscriptionId` | string | No | Subscription ID (priority, use this if you know the subscription) | | `userId` | integer | No | User ID (alternative to subscriptionId) | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/metric/limit_adjust" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "amount": 0, "metricCode": "", "productId": 0, "reason": "", "subscriptionId": "id_example", "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/metric/limit_adjust" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "amount": 0, "metricCode": "", "productId": 0, "reason": "", "subscriptionId": "id_example", "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.success` | boolean | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Reprocess Metric Carry Over (Admin Tool) Source: https://docs.unibee.dev/api-reference/metric-limit-quota/reprocess-metric-carry-over-admin-tool post /merchant/metric/carryover/reprocess ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/metric/carryover/reprocess` Reprocess Metric Carry Over (Admin Tool) *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------------- | ------ | -------- | ------------------------------------------------------ | | `previousInvoiceId` | string | Yes | Previous period's Invoice ID to recalculate carry over | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/metric/carryover/reprocess" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "previousInvoiceId": "id_example" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/metric/carryover/reprocess" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "previousInvoiceId": "id_example" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.message` | string | | | `data.success` | boolean | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Delete Merchant Metric Source: https://docs.unibee.dev/api-reference/metric/delete-merchant-metric post /merchant/metric/delete ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/metric/delete` Delete Merchant Metric *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------- | ------- | -------- | ----------- | | `metricId` | integer | Yes | MetricId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/metric/delete" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "metricId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/metric/delete" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "metricId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.merchantMetric` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Delete Merchant Metric Plan TotalLimit Source: https://docs.unibee.dev/api-reference/metric/delete-merchant-metric-plan-totallimit post /merchant/metric/plan/limit/delete ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/metric/plan/limit/delete` Delete Merchant Metric Plan TotalLimit *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------------- | ------- | -------- | ----------------- | | `metricPlanLimitId` | integer | Yes | MetricPlanLimitId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/metric/plan/limit/delete" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "metricPlanLimitId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/metric/plan/limit/delete" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "metricPlanLimitId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------------------ | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.merchantMetricPlanLimit` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Edit Merchant Metric Source: https://docs.unibee.dev/api-reference/metric/edit-merchant-metric post /merchant/metric/edit ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/metric/edit` Edit Merchant Metric *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | --------------------------- | ------- | -------- | ------------------------------------------------------------------------------------------------------ | | `carryoverProrationEnabled` | boolean | No | Enable carryover proration for this metric (default: false when not set) | | `metaData` | object | No | meta\_data(json) | | `metricDescription` | string | No | MetricDescription | | `metricId` | integer | Yes | MetricId | | `metricName` | string | Yes | MetricName | | `prorationRefundEnabled` | boolean | No | Enable proration refund for this metric (reclaim metric limit on upgrade; default: false when not set) | | `type` | integer | No | 1-limit\_metered,2-charge\_metered,3-charge\_recurring,4-limit\_recurring | | `unit` | string | No | unit | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/metric/edit" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "carryoverProrationEnabled": false, "metaData": {}, "metricDescription": "", "metricId": 0, "metricName": "", "prorationRefundEnabled": false, "type": 0, "unit": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/metric/edit" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "carryoverProrationEnabled": false, "metaData": {}, "metricDescription": "", "metricId": 0, "metricName": "", "prorationRefundEnabled": false, "type": 0, "unit": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.merchantMetric` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Edit Merchant Metric Plan TotalLimit Source: https://docs.unibee.dev/api-reference/metric/edit-merchant-metric-plan-totallimit post /merchant/metric/plan/limit/edit ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/metric/plan/limit/edit` Edit Merchant Metric Plan TotalLimit *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------------- | ------- | -------- | ----------------- | | `metricLimit` | integer | Yes | MetricLimit | | `metricPlanLimitId` | integer | Yes | MetricPlanLimitId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/metric/plan/limit/edit" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "metricLimit": 0, "metricPlanLimitId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/metric/plan/limit/edit" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "metricLimit": 0, "metricPlanLimitId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------------------ | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.merchantMetricPlanLimit` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Merchant Metric list Source: https://docs.unibee.dev/api-reference/metric/get-merchant-metric-list get /merchant/metric/list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/metric/list` Get Merchant Metric list *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ----------------- | ------- | -------- | ---------------------------------------------- | | `searchKey` | string | No | Search Key, code or name | | `sortField` | string | No | Sort,user\_id\|gmt\_create,Default gmt\_create | | `sortType` | string | No | Sort Type,asc\|desc,Default desc | | `page` | integer | No | Page,Start 0 | | `count` | integer | No | Count OF Page | | `createTimeStart` | integer | No | CreateTimeStart,UTC timestamp,seconds | | `createTimeEnd` | integer | No | CreateTimeEnd,UTC timestamp,seconds | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/metric/list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/metric/list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ---------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.merchantMetrics` | array | MerchantMetrics | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Merchant Metric list Source: https://docs.unibee.dev/api-reference/metric/get-merchant-metric-list-1 post /merchant/metric/list ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/metric/list` Get Merchant Metric list *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------------- | ------- | -------- | ---------------------------------------------- | | `count` | integer | No | Count OF Page | | `createTimeEnd` | integer | No | CreateTimeEnd,UTC timestamp,seconds | | `createTimeStart` | integer | No | CreateTimeStart,UTC timestamp,seconds | | `page` | integer | No | Page,Start 0 | | `searchKey` | string | No | Search Key, code or name | | `sortField` | string | No | Sort,user\_id\|gmt\_create,Default gmt\_create | | `sortType` | string | No | Sort Type,asc\|desc,Default desc | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/metric/list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "count": 0, "createTimeEnd": 0, "createTimeStart": 0, "page": 0, "searchKey": "", "sortField": "", "sortType": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/metric/list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "count": 0, "createTimeEnd": 0, "createTimeStart": 0, "page": 0, "searchKey": "", "sortField": "", "sortType": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ---------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.merchantMetrics` | array | MerchantMetrics | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Merchant Metric Detail Source: https://docs.unibee.dev/api-reference/metric/merchant-metric-detail post /merchant/metric/detail ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/metric/detail` Merchant Metric Detail *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------- | ------- | -------- | ----------- | | `metricId` | integer | Yes | MetricId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/metric/detail" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "metricId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/metric/detail" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "metricId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.merchantMetric` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # New Merchant Metric Source: https://docs.unibee.dev/api-reference/metric/new-merchant-metric post /merchant/metric/new ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/metric/new` New Merchant Metric *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | --------------------------- | ------- | -------- | ------------------------------------------------------------------------------------------------------ | | `aggregationProperty` | string | No | AggregationProperty, Will Needed When AggregationType != count | | `aggregationType` | integer | No | AggregationType,1-count,2-count unique, 3-latest, 4-max, 5-sum | | `carryoverProrationEnabled` | boolean | No | Enable carryover proration for this metric (default: false when not set) | | `code` | string | Yes | Code | | `metaData` | object | No | meta\_data(json) | | `metricDescription` | string | No | MetricDescription | | `metricName` | string | Yes | MetricName | | `prorationRefundEnabled` | boolean | No | Enable proration refund for this metric (reclaim metric limit on upgrade; default: false when not set) | | `type` | integer | No | 1-limit\_metered,2-charge\_metered,3-charge\_recurring,4-limit\_recurring | | `unit` | string | No | unit | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/metric/new" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "aggregationProperty": "", "aggregationType": 0, "carryoverProrationEnabled": false, "code": "", "metaData": {}, "metricDescription": "", "metricName": "", "prorationRefundEnabled": false, "type": 0, "unit": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/metric/new" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "aggregationProperty": "", "aggregationType": 0, "carryoverProrationEnabled": false, "code": "", "metaData": {}, "metricDescription": "", "metricName": "", "prorationRefundEnabled": false, "type": 0, "unit": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.merchantMetric` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # New Merchant Metric Plan TotalLimit Source: https://docs.unibee.dev/api-reference/metric/new-merchant-metric-plan-totallimit post /merchant/metric/plan/limit/new ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/metric/plan/limit/new` New Merchant Metric Plan TotalLimit *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------- | ------- | -------- | ----------- | | `metricId` | integer | Yes | MetricId | | `metricLimit` | integer | Yes | MetricLimit | | `planId` | integer | Yes | PlanId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/metric/plan/limit/new" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "metricId": 0, "metricLimit": 0, "planId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/metric/plan/limit/new" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "metricId": 0, "metricLimit": 0, "planId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------------------ | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.merchantMetricPlanLimit` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Cancel Payment Source: https://docs.unibee.dev/api-reference/payment/cancel-payment post /merchant/payment/cancel ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/payment/cancel` Cancel Payment *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------- | ------ | -------- | ------------------------ | | `paymentId` | string | Yes | The unique id of payment | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/payment/cancel" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "paymentId": "id_example" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/payment/cancel" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "paymentId": "id_example" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Cancel Payment Refund Source: https://docs.unibee.dev/api-reference/payment/cancel-payment-refund post /merchant/payment/refund/cancel ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/payment/refund/cancel` Cancel Payment Refund *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------- | ------ | -------- | ----------------------- | | `refundId` | string | Yes | The unique id of refund | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/payment/refund/cancel" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "refundId": "id_example" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/payment/refund/cancel" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "refundId": "id_example" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Capture Payment Source: https://docs.unibee.dev/api-reference/payment/capture-payment post /merchant/payment/capture ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/payment/capture` Capture Payment *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------------- | ------ | -------- | ---------------------------------- | | `externalCaptureId` | string | Yes | The external id of payment capture | | `paymentId` | string | Yes | The unique id of payment | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/payment/capture" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalCaptureId": "id_example", "paymentId": "id_example" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/payment/capture" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalCaptureId": "id_example", "paymentId": "id_example" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Create New Payment Method Source: https://docs.unibee.dev/api-reference/payment/create-new-payment-method post /merchant/payment/method_new ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/payment/method_new` Create New Payment Method *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------- | ------- | -------- | ------------------------------------------------ | | `currency` | string | No | The currency of payment method | | `gatewayId` | integer | Yes | The unique id of gateway | | `metadata` | object | No | Metadata,Map | | `redirectUrl` | string | No | The redirect url when method created return back | | `subscriptionId` | string | No | The id of subscription that want to attach | | `type` | string | No | | | `userId` | integer | Yes | The customer's unique id | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/payment/method_new" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "currency": "", "gatewayId": 0, "metadata": {}, "redirectUrl": "https://example.com", "subscriptionId": "id_example", "type": "", "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/payment/method_new" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "currency": "", "gatewayId": 0, "metadata": {}, "redirectUrl": "https://example.com", "subscriptionId": "id_example", "type": "", "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------- | ------- | -------------------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.method` | object | | | `data.url` | string | The gateway url to create a new method | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Delete Payment Method Source: https://docs.unibee.dev/api-reference/payment/delete-payment-method post /merchant/payment/method_delete ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/payment/method_delete` Delete Payment Method *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------------- | ------- | -------- | ------------------------------- | | `gatewayId` | integer | Yes | The unique id of gateway | | `paymentMethodId` | string | Yes | The unique id of payment method | | `userId` | integer | Yes | The customer's unique id | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/payment/method_delete" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "gatewayId": 0, "paymentMethodId": "id_example", "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/payment/method_delete" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "gatewayId": 0, "paymentMethodId": "id_example", "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get OneTime Payment Item List Source: https://docs.unibee.dev/api-reference/payment/get-onetime-payment-item-list get /merchant/payment/item/list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/payment/item/list` Get OneTime Payment Item List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ----------- | ------- | -------- | ------------------------------------------------------------------------------------------ | | `userId` | integer | No | Filter UserId, Default All | | `sortField` | string | No | Sort,invoice\_id\|gmt\_create\|gmt\_modify\|period\_end\|total\_amount,Default gmt\_modify | | `sortType` | string | No | Sort Type,asc\|desc,Default desc | | `page` | integer | No | Page,Start 0 | | `count` | integer | No | Count Of Page | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/payment/item/list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/payment/item/list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.paymentItems` | array | Payment Item Object List | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Payment List Source: https://docs.unibee.dev/api-reference/payment/get-payment-list get /merchant/payment/list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/payment/list` Get Payment List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ------------- | ------- | -------- | ----------------------------------------------------------------------------- | | `gatewayId` | integer | No | The filter unique id of gateway | | `userId` | integer | No | The filter userid of payment | | `email` | string | No | The filter email of payment | | `status` | integer | No | The filter status of payment, 10-Created\|20-Success\|30-Failed\|40-Cancelled | | `currency` | string | No | The filter currency of payment | | `countryCode` | string | No | The filter country code of payment | | `sortField` | string | No | Sort Field,user\_id\|create\_time\|status | | `sortType` | string | No | Sort Type,asc\|desc | | `page` | integer | No | Page, Start With 0 | | `count` | integer | No | Count Of Page | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/payment/list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/payment/list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.paymentDetails` | array | Payment Detail Object List | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Payment Refund List Source: https://docs.unibee.dev/api-reference/payment/get-payment-refund-list get /merchant/payment/refund/list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/payment/refund/list` Get Payment Refund List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ----------- | ------- | -------- | --------------------------------------------------- | | `paymentId` | string | Yes | PaymentId | | `status` | integer | No | Status,10-create\|20-success\|30-Failed\|40-Reverse | | `gatewayId` | integer | No | GatewayId | | `userId` | integer | No | UserId | | `email` | string | No | Email | | `currency` | string | No | Currency | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/payment/refund/list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/payment/refund/list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.refundDetails` | array | Refund Detail Object List | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Payment TimeLine List Source: https://docs.unibee.dev/api-reference/payment/get-payment-timeline-list get /merchant/payment/timeline/list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/payment/timeline/list` Get Payment TimeLine List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ----------------- | ------- | -------- | ------------------------------------------------------------------------------------------ | | `userId` | integer | No | Filter UserId, Default All | | `amountStart` | integer | No | The filter start amount of timeline | | `amountEnd` | integer | No | The filter end amount of timeline | | `searchKey` | string | No | Search SubscriptionId\|InvoiceId\|PaymentId\|UserId | | `status` | array | No | The filter status, 0-pending, 1-success, 2-failure,3-cancel | | `timelineTypes` | array | No | The filter timelineType, 0-pay, 1-refund | | `gatewayIds` | array | No | The filter ids of gateway | | `currency` | string | No | Currency | | `sortField` | string | No | Sort,invoice\_id\|gmt\_create\|gmt\_modify\|period\_end\|total\_amount,Default gmt\_modify | | `sortType` | string | No | Sort Type,asc\|desc,Default desc | | `page` | integer | No | Page,Start 0 | | `count` | integer | No | Count Of Page | | `createTimeStart` | integer | No | CreateTimeStart,UTC timestamp,seconds | | `createTimeEnd` | integer | No | CreateTimeEnd,UTC timestamp,seconds | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/payment/timeline/list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/payment/timeline/list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.paymentTimeLines` | array | Payment TimeLine Object List | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Payment TimeLine List Source: https://docs.unibee.dev/api-reference/payment/get-payment-timeline-list-1 post /merchant/payment/timeline/list ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/payment/timeline/list` Get Payment TimeLine List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------------- | ------- | -------- | ------------------------------------------------------------------------------------------ | | `amountEnd` | integer | No | The filter end amount of timeline | | `amountStart` | integer | No | The filter start amount of timeline | | `count` | integer | No | Count Of Page | | `createTimeEnd` | integer | No | CreateTimeEnd,UTC timestamp,seconds | | `createTimeStart` | integer | No | CreateTimeStart,UTC timestamp,seconds | | `currency` | string | No | Currency | | `gatewayIds` | array | No | The filter ids of gateway | | `page` | integer | No | Page,Start 0 | | `searchKey` | string | No | Search SubscriptionId\|InvoiceId\|PaymentId\|UserId | | `sortField` | string | No | Sort,invoice\_id\|gmt\_create\|gmt\_modify\|period\_end\|total\_amount,Default gmt\_modify | | `sortType` | string | No | Sort Type,asc\|desc,Default desc | | `status` | array | No | The filter status, 0-pending, 1-success, 2-failure,3-cancel | | `timelineTypes` | array | No | The filter timelineType, 0-pay, 1-refund | | `userId` | integer | No | Filter UserId, Default All | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/payment/timeline/list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "amountEnd": 0, "amountStart": 0, "count": 0, "createTimeEnd": 0, "createTimeStart": 0, "currency": "", "gatewayIds": [], "page": 0, "searchKey": "", "sortField": "", "sortType": "", "status": [], "timelineTypes": 0, "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/payment/timeline/list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "amountEnd": 0, "amountStart": 0, "count": 0, "createTimeEnd": 0, "createTimeStart": 0, "currency": "", "gatewayIds": [], "page": 0, "searchKey": "", "sortField": "", "sortType": "", "status": [], "timelineTypes": 0, "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.paymentTimeLines` | array | Payment TimeLine Object List | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Mark External Gateway Payment As Failed Source: https://docs.unibee.dev/api-reference/payment/mark-external-gateway-payment-as-failed post /merchant/payment/external_gateway_payment/mark_failed Mark payment as failed using external gateway result. Auth: OpenAPI + signature (HMAC-SHA256, hex). ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/payment/external_gateway_payment/mark_failed` Mark payment as failed using external gateway result. Auth: OpenAPI + signature (HMAC-SHA256, hex). *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------------------- | ------- | -------- | ----------------------------------------------------------------------------------------------------------- | | `externalTransactionId` | string | Yes | External payment transaction id from gateway, used for correlation | | `failureReason` | string | No | Human-readable failure reason from external gateway | | `gatewayId` | integer | No | External gateway id (optional), if omitted will be resolved from paymentId | | `paymentId` | string | Yes | The UniBee paymentId | | `signature` | string | Yes | HMAC-SHA256 hex signature using External Gateway API Key over 'paymentId\|externalTransactionId\|timestamp' | | `timestamp` | integer | Yes | Unix timestamp in seconds, used for signature and anti-replay | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/payment/external_gateway_payment/mark_failed" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalTransactionId": "id_example", "failureReason": "", "gatewayId": 0, "paymentId": "id_example", "signature": "", "timestamp": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/payment/external_gateway_payment/mark_failed" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalTransactionId": "id_example", "failureReason": "", "gatewayId": 0, "paymentId": "id_example", "signature": "", "timestamp": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ---------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.invoiceId` | string | The related UniBee invoiceId | | `data.paymentId` | string | The UniBee paymentId | | `data.status` | string | Result status, e.g. failed | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Mark External Gateway Payment As Paid Source: https://docs.unibee.dev/api-reference/payment/mark-external-gateway-payment-as-paid post /merchant/payment/external_gateway_payment/mark_paid Mark payment as paid using external gateway result. Auth: OpenAPI + signature (HMAC-SHA256, hex). ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/payment/external_gateway_payment/mark_paid` Mark payment as paid using external gateway result. Auth: OpenAPI + signature (HMAC-SHA256, hex). *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------------------- | ------- | -------- | ----------------------------------------------------------------------------------------------------------- | | `externalTransactionId` | string | Yes | External payment transaction id from gateway, used as idempotent key | | `gatewayId` | integer | No | External gateway id (optional), if omitted will be resolved from paymentId | | `metadata` | object | No | Additional metadata from external gateway | | `paidTime` | integer | No | Payment success time (unix timestamp in seconds, optional) | | `paymentId` | string | Yes | The UniBee paymentId | | `signature` | string | Yes | HMAC-SHA256 hex signature using External Gateway API Key over 'paymentId\|externalTransactionId\|timestamp' | | `timestamp` | integer | Yes | Unix timestamp in seconds, used for signature and anti-replay | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/payment/external_gateway_payment/mark_paid" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalTransactionId": "id_example", "gatewayId": 0, "metadata": {}, "paidTime": 0, "paymentId": "id_example", "signature": "", "timestamp": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/payment/external_gateway_payment/mark_paid" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalTransactionId": "id_example", "gatewayId": 0, "metadata": {}, "paidTime": 0, "paymentId": "id_example", "signature": "", "timestamp": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------------- | ------- | ------------------------------------------ | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.invoiceId` | string | The related UniBee invoiceId | | `data.paymentId` | string | The UniBee paymentId | | `data.status` | string | Result status, e.g. success | | `data.subscriptionId` | string | The related UniBee subscriptionId (if any) | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Mark External Gateway Refund As Failed Source: https://docs.unibee.dev/api-reference/payment/mark-external-gateway-refund-as-failed post /merchant/payment/external_gateway_refund/mark_failed Mark refund as failed using external gateway result. Auth: OpenAPI + signature (HMAC-SHA256, hex). ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/payment/external_gateway_refund/mark_failed` Mark refund as failed using external gateway result. Auth: OpenAPI + signature (HMAC-SHA256, hex). *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------------ | ------- | -------- | ----------------------------------------------------------------------------------------------------- | | `externalRefundId` | string | Yes | External refund transaction id from gateway, used as idempotent key | | `failureReason` | string | Yes | Human-readable failure reason from external gateway | | `gatewayId` | integer | No | External gateway id (optional), if omitted will be resolved from refundId | | `refundId` | string | Yes | The UniBee refundId | | `signature` | string | Yes | HMAC-SHA256 hex signature using External Gateway API Key over 'refundId\|externalRefundId\|timestamp' | | `timestamp` | integer | Yes | Unix timestamp in seconds, used for signature and anti-replay | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/payment/external_gateway_refund/mark_failed" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalRefundId": "id_example", "failureReason": "", "gatewayId": 0, "refundId": "id_example", "signature": "", "timestamp": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/payment/external_gateway_refund/mark_failed" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalRefundId": "id_example", "failureReason": "", "gatewayId": 0, "refundId": "id_example", "signature": "", "timestamp": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ---------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.paymentId` | string | The related UniBee paymentId | | `data.refundId` | string | The UniBee refundId | | `data.status` | string | Result status, e.g. failed | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Mark External Gateway Refund As Success Source: https://docs.unibee.dev/api-reference/payment/mark-external-gateway-refund-as-success post /merchant/payment/external_gateway_refund/mark_success Mark refund as success using external gateway result. Auth: OpenAPI + signature (HMAC-SHA256, hex). ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/payment/external_gateway_refund/mark_success` Mark refund as success using external gateway result. Auth: OpenAPI + signature (HMAC-SHA256, hex). *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------------ | ------- | -------- | ----------------------------------------------------------------------------------------------------- | | `externalRefundId` | string | Yes | External refund transaction id from gateway, used as idempotent key | | `gatewayId` | integer | No | External gateway id (optional), if omitted will be resolved from refundId | | `refundId` | string | Yes | The UniBee refundId | | `signature` | string | Yes | HMAC-SHA256 hex signature using External Gateway API Key over 'refundId\|externalRefundId\|timestamp' | | `timestamp` | integer | Yes | Unix timestamp in seconds, used for signature and anti-replay | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/payment/external_gateway_refund/mark_success" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalRefundId": "id_example", "gatewayId": 0, "refundId": "id_example", "signature": "", "timestamp": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/payment/external_gateway_refund/mark_success" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalRefundId": "id_example", "gatewayId": 0, "refundId": "id_example", "signature": "", "timestamp": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ---------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.paymentId` | string | The related UniBee paymentId | | `data.refundId` | string | The UniBee refundId | | `data.status` | string | Result status, e.g. success | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # New Payment Source: https://docs.unibee.dev/api-reference/payment/new-payment post /merchant/payment/new ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/payment/new` New Payment *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | -------------------- | ------- | -------- | ------------------------------------------------------------------------ | | `cancelUrl` | string | No | CancelUrl | | `countryCode` | string | No | CountryCode | | `currency` | string | No | Currency, either Currency\&TotalAmount or PlanId needed | | `description` | string | No | Description | | `email` | string | No | Email, either ExternalUserId\&Email or UserId needed | | `externalPaymentId` | string | No | ExternalPaymentId should unique for payment | | `externalUserId` | string | No | ExternalUserId, unique, either ExternalUserId\&Email or UserId needed | | `gasPayer` | string | No | who pay the gas, merchant\|user | | `gatewayId` | integer | Yes | GatewayId | | `gatewayPaymentType` | string | No | GatewayPaymentType | | `items` | array | No | Items | | `metadata` | object | No | Metadata,Map | | `name` | string | No | Name | | `paymentType` | string | No | Payment Type | | `paymentUIMode` | string | No | The checkout UI Mode, hosted\|embedded\|custom, default hosted | | `planId` | integer | No | PlanId, either TotalAmount\&Currency or PlanId needed | | `quantity` | integer | No | Quantity,used when planId not null, Default 1 | | `redirectUrl` | string | No | Redirect Url | | `sendInvoice` | boolean | No | Whether sen invoice email to customer or not,default false | | `totalAmount` | integer | No | Total PaymentAmount, Cent, either TotalAmount\&Currency or PlanId needed | | `userId` | integer | No | UserId, either ExternalUserId\&Email or UserId needed | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/payment/new" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "cancelUrl": "https://example.com", "countryCode": "", "currency": "", "description": "", "email": "user@example.com", "externalPaymentId": "id_example", "externalUserId": "id_example", "gasPayer": "", "gatewayId": 0, "gatewayPaymentType": "", "items": [], "metadata": {}, "name": "", "paymentType": "", "paymentUIMode": "", "planId": 0, "quantity": 0, "redirectUrl": "https://example.com", "sendInvoice": false, "totalAmount": 0, "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/payment/new" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "cancelUrl": "https://example.com", "countryCode": "", "currency": "", "description": "", "email": "user@example.com", "externalPaymentId": "id_example", "externalUserId": "id_example", "gasPayer": "", "gatewayId": 0, "gatewayPaymentType": "", "items": [], "metadata": {}, "name": "", "paymentType": "", "paymentUIMode": "", "planId": 0, "quantity": 0, "redirectUrl": "https://example.com", "sendInvoice": false, "totalAmount": 0, "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------------ | ------- | ------------------------------------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.action` | object | | | `data.externalPaymentId` | string | The external unique id of payment | | `data.invoiceId` | string | The unique id of invoice | | `data.link` | string | | | `data.paymentId` | string | The unique id of payment | | `data.status` | integer | Status, 10-Created\|20-Success\|30-Failed\|40-Cancelled | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # New Payment Refund Source: https://docs.unibee.dev/api-reference/payment/new-payment-refund post /merchant/payment/refund/new ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/payment/refund/new` New Payment Refund *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------------ | ------- | -------- | ------------------ | | `currency` | string | Yes | Currency | | `externalRefundId` | string | Yes | ExternalRefundId | | `metadata` | object | No | Metadata,Map | | `paymentId` | string | Yes | PaymentId | | `reason` | string | No | Reason | | `refundAmount` | integer | Yes | RefundAmount, Cent | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/payment/refund/new" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "currency": "", "externalRefundId": "id_example", "metadata": {}, "paymentId": "id_example", "reason": "", "refundAmount": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/payment/refund/new" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "currency": "", "externalRefundId": "id_example", "metadata": {}, "paymentId": "id_example", "reason": "", "refundAmount": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------------------- | ------- | --------------------------------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.externalRefundId` | string | ExternalRefundId | | `data.paymentId` | string | PaymentId | | `data.refundId` | string | RefundId | | `data.status` | integer | Status,10-create\|20-success\|30-Failed\|40-Reverse | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Payment Detail Source: https://docs.unibee.dev/api-reference/payment/payment-detail get /merchant/payment/detail ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/payment/detail` Payment Detail *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ----------- | ------ | -------- | ------------------------ | | `paymentId` | string | Yes | The unique id of payment | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/payment/detail" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/payment/detail" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.paymentDetail` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Payment Method Source: https://docs.unibee.dev/api-reference/payment/payment-method get /merchant/payment/method_get The method of payment gateway ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/payment/method_get` The method of payment gateway *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ----------------- | ------- | -------- | ------------------------------- | | `gatewayId` | integer | Yes | The unique id of gateway | | `userId` | integer | Yes | The customer's unique id | | `paymentMethodId` | string | Yes | The unique id of payment method | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/payment/method_get" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/payment/method_get" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.method` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Payment Method List Source: https://docs.unibee.dev/api-reference/payment/payment-method-list get /merchant/payment/method_list The method list of payment gateway ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/payment/method_list` The method list of payment gateway *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ----------- | ------- | -------- | ------------------------ | | `gatewayId` | integer | Yes | The unique id of gateway | | `userId` | integer | No | The id of user | | `paymentId` | string | No | The unique id of payment | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/payment/method_list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/payment/method_list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.methodList` | array | Payment Method Object List | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Payment Refund Detail Source: https://docs.unibee.dev/api-reference/payment/payment-refund-detail get /merchant/payment/refund/detail ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/payment/refund/detail` Payment Refund Detail *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ---------- | ------ | -------- | ----------- | | `refundId` | string | No | RefundId | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/payment/refund/detail" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/payment/refund/detail" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.refundDetail` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Update External Gateway Payment Link Source: https://docs.unibee.dev/api-reference/payment/update-external-gateway-payment-link post /merchant/payment/external_gateway_payment/update_link Update external checkout link for a payment. Auth: OpenAPI + signature (HMAC-SHA256, hex). ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/payment/external_gateway_payment/update_link` Update external checkout link for a payment. Auth: OpenAPI + signature (HMAC-SHA256, hex). *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------------------- | ------- | -------- | ----------------------------------------------------------------------------------------------------------- | | `externalTransactionId` | string | Yes | External payment transaction id from gateway, used as idempotent key | | `gatewayId` | integer | No | External gateway id (optional), if omitted will be resolved from paymentId | | `paymentId` | string | Yes | The UniBee paymentId | | `paymentLink` | string | Yes | External checkout URL for this payment | | `sendInvoice` | boolean | No | Whether to send invoice email to customer after updating link | | `signature` | string | Yes | HMAC-SHA256 hex signature using External Gateway API Key over 'paymentId\|externalTransactionId\|timestamp' | | `timestamp` | integer | Yes | Unix timestamp in seconds, used for signature and anti-replay | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/payment/external_gateway_payment/update_link" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalTransactionId": "id_example", "gatewayId": 0, "paymentId": "id_example", "paymentLink": "", "sendInvoice": false, "signature": "", "timestamp": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/payment/external_gateway_payment/update_link" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalTransactionId": "id_example", "gatewayId": 0, "paymentId": "id_example", "paymentLink": "", "sendInvoice": false, "signature": "", "timestamp": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ---------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.invoiceId` | string | The related UniBee invoiceId | | `data.paymentId` | string | The UniBee paymentId | | `data.status` | string | Result status, e.g. success | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Activate Plan Source: https://docs.unibee.dev/api-reference/plan/activate-plan post /merchant/plan/activate ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/plan/activate` Activate Plan *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------- | ------- | -------- | --------------------------------------------------------------------- | | `externalPlanId` | string | No | The ExternalId of plan, either externalPlanId or planId should be set | | `planId` | integer | No | The Id of plan, either planId or externalPlanId should be set | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/plan/activate" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalPlanId": "id_example", "planId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/plan/activate" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalPlanId": "id_example", "planId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Addon Binding Source: https://docs.unibee.dev/api-reference/plan/addon-binding post /merchant/plan/addons_binding ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/plan/addons_binding` Addon Binding *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------------- | ------- | -------- | ------------------------------------- | | `action` | integer | Yes | Action Type,0-override,1-add,2-delete | | `addonIds` | array | Yes | Plan Ids Of Recurring Addon Type | | `onetimeAddonIds` | array | Yes | Plan Ids Of Onetime Addon Type | | `planId` | integer | Yes | PlanID | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/plan/addons_binding" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "action": 0, "addonIds": [], "onetimeAddonIds": 0, "planId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/plan/addons_binding" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "action": 0, "addonIds": [], "onetimeAddonIds": 0, "planId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.plan` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Archive Plan Source: https://docs.unibee.dev/api-reference/plan/archive-plan post /merchant/plan/archive ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/plan/archive` Archive Plan *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------- | ------- | -------- | --------------------------------------------------------------------- | | `externalPlanId` | string | No | The ExternalId of plan, either externalPlanId or planId should be set | | `hardArchive` | boolean | No | Hard Archive | | `planId` | integer | No | The Id of plan, either planId or externalPlanId should be set | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/plan/archive" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalPlanId": "id_example", "hardArchive": false, "planId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/plan/archive" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalPlanId": "id_example", "hardArchive": false, "planId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Confirm Active Plan Price Change Source: https://docs.unibee.dev/api-reference/plan/confirm-active-plan-price-change post /merchant/plan/active_price_change/confirm Confirm and apply price change for an active plan. ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/plan/active_price_change/confirm` Confirm and apply price change for an active plan. *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------------ | ------- | -------- | ---------------------------------------------------------- | | `confirmOldAmount` | integer | Yes | Old amount expected by caller, used for optimistic locking | | `newAmount` | integer | Yes | New amount (in smallest currency unit, e.g. cents) | | `planId` | integer | Yes | Target planId, must be active | | `reason` | string | No | Reason or note for this price change | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/plan/active_price_change/confirm" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "confirmOldAmount": 0, "newAmount": 0, "planId": 0, "reason": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/plan/active_price_change/confirm" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "confirmOldAmount": 0, "newAmount": 0, "planId": 0, "reason": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ---------------------------------- | ------- | ------------------------------------------------------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.activeAffectedSubscriptions` | integer | Active/processing subscriptions whose future billing will be affected | | `data.newAmount` | integer | New amount after change | | `data.oldAmount` | integer | Old amount before change | | `data.planId` | integer | Target planId | | `data.totalAffectedSubscriptions` | integer | Total subscriptions that have used or are using this plan (by status set) | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Copy Plan Source: https://docs.unibee.dev/api-reference/plan/copy-plan post /merchant/plan/copy ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/plan/copy` Copy Plan *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------- | ------- | -------- | --------------------------------------------------------------------- | | `externalPlanId` | string | No | The ExternalId of plan, either externalPlanId or planId should be set | | `planId` | integer | No | The Id of plan, either planId or externalPlanId should be set | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/plan/copy" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalPlanId": "id_example", "planId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/plan/copy" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalPlanId": "id_example", "planId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.plan` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Create Plan Source: https://docs.unibee.dev/api-reference/plan/create-plan post /merchant/plan/new ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/plan/new` Create Plan *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------------------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------- | | `addonIds` | array | No | Plan Ids Of Recurring Addon Type | | `amount` | integer | Yes | Plan Amount | | `cancelAtTrialEnd` | integer | No | whether cancel at subscription first trial end,0-false \| 1-true, will pass to cancelAtPeriodEnd of subscription | | `currency` | string | Yes | Plan Currency | | `description` | string | No | Description | | `externalPlanId` | string | No | ExternalPlanId | | `gasPayer` | string | No | who pay the gas for crypto payment, merchant\|user | | `homeUrl` | string | No | HomeUrl,Start With: http | | `imageUrl` | string | No | ImageUrl,Start With: http | | `internalName` | string | No | | | `intervalCount` | integer | No | Number Of IntervalUnit,em: day\|month\|year\|week | | `intervalUnit` | string | No | Plan Interval Unit,em: day\|month\|year\|week | | `metadata` | object | No | Metadata,Map | | `metricLimits` | array | No | Plan's MetricLimit List | | `metricMeteredCharge` | array | No | Plan's MetricMeteredCharge | | `metricRecurringCharge` | array | No | Plan's MetricRecurringCharge | | `multiCurrencies` | array | No | Plan's MultiCurrencies | | `onetimeAddonIds` | array | No | Plan Ids Of Onetime Addon Type | | `planName` | string | Yes | Plan Name | | `productDescription` | string | No | Default Copy Description | | `productId` | integer | No | Id of product which plan to linked | | `productName` | string | No | Default Copy PlanName | | `trialAmount` | integer | No | price of trial period, not available for addon | | `trialDemand` | string | No | demand of trial, not available for addon, example, paymentMethod, payment method will ask for subscription trial start | | `trialDurationTime` | integer | No | duration of trial, not available for addon | | `type` | integer | No | The type of plan, 1-main plan,2-addon plan, 3-onetime plan, default main plan | | `usVATConfig` | string | No | | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/plan/new" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "addonIds": [], "amount": 0, "cancelAtTrialEnd": 0, "currency": "", "description": "", "externalPlanId": "id_example", "gasPayer": "", "homeUrl": "https://example.com", "imageUrl": "https://example.com", "internalName": "", "intervalCount": 0, "intervalUnit": "", "metadata": {}, "metricLimits": [], "metricMeteredCharge": [], "metricRecurringCharge": [], "multiCurrencies": [], "onetimeAddonIds": 0, "planName": "", "productDescription": "", "productId": 0, "productName": "", "trialAmount": 0, "trialDemand": "", "trialDurationTime": 0, "type": 0, "usVATConfig": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/plan/new" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "addonIds": [], "amount": 0, "cancelAtTrialEnd": 0, "currency": "", "description": "", "externalPlanId": "id_example", "gasPayer": "", "homeUrl": "https://example.com", "imageUrl": "https://example.com", "internalName": "", "intervalCount": 0, "intervalUnit": "", "metadata": {}, "metricLimits": [], "metricMeteredCharge": [], "metricRecurringCharge": [], "multiCurrencies": [], "onetimeAddonIds": 0, "planName": "", "productDescription": "", "productId": 0, "productName": "", "trialAmount": 0, "trialDemand": "", "trialDurationTime": 0, "type": 0, "usVATConfig": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.plan` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Delete Plan Source: https://docs.unibee.dev/api-reference/plan/delete-plan post /merchant/plan/delete ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/plan/delete` Delete Plan *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------- | ------- | -------- | --------------------------------------------------------------------- | | `externalPlanId` | string | No | The ExternalId of plan, either externalPlanId or planId should be set | | `planId` | integer | No | The Id of plan, either planId or externalPlanId should be set | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/plan/delete" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalPlanId": "id_example", "planId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/plan/delete" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalPlanId": "id_example", "planId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Edit Plan Source: https://docs.unibee.dev/api-reference/plan/edit-plan post /merchant/plan/edit Edit exist plan, amount|currency|intervalUnit|intervalCount is not editable when plan is active ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/plan/edit` Edit exist plan, amount|currency|intervalUnit|intervalCount is not editable when plan is active *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------------------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------- | | `addonIds` | array | No | Plan Ids Of Recurring Addon Type | | `amount` | integer | No | CaptureAmount of plan, not editable when plan is active | | `cancelAtTrialEnd` | integer | No | whether cancel at subscription first trial end,0-false \| 1-true, will pass to cancelAtPeriodEnd of subscription | | `currency` | string | No | Currency of plan, not editable when plan is active | | `description` | string | No | Description of plan | | `externalPlanId` | string | No | ExternalPlanId | | `gasPayer` | string | No | who pay the gas for crypto payment, merchant\|user | | `homeUrl` | string | No | HomeUrl,Start With: http | | `imageUrl` | string | No | ImageUrl,Start With: http | | `internalName` | string | No | | | `intervalCount` | integer | No | Number,intervalUnit of plan, not editable when plan is active | | `intervalUnit` | string | No | Interval unit of plan,em: day\|month\|year\|week, not editable when plan is active | | `metadata` | object | No | Metadata,Map | | `metricLimits` | array | No | Plan's MetricLimit List, nil means no change, empty array means delete all, array with data means full replace | | `metricMeteredCharge` | array | No | Plan's MetricMeteredCharge | | `metricRecurringCharge` | array | No | Plan's MetricRecurringCharge | | `multiCurrencies` | array | No | Plan's MultiCurrencies | | `onetimeAddonIds` | array | No | Plan Ids Of Onetime Addon Type | | `planId` | integer | Yes | Id of plan | | `planName` | string | No | Name of plan | | `productDescription` | string | No | ProductDescription of plan, Default copy description | | `productId` | integer | No | Id of product which plan to linked | | `productName` | string | No | ProductName of plan, Default copy planName | | `trialAmount` | integer | No | price of trial period, not available for addon | | `trialDemand` | string | No | demand of trial, not available for addon, example, paymentMethod, payment method will ask for subscription trial start | | `trialDurationTime` | integer | No | duration of trial,seconds, not available for addon | | `usVATConfig` | string | No | | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/plan/edit" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "addonIds": [], "amount": 0, "cancelAtTrialEnd": 0, "currency": "", "description": "", "externalPlanId": "id_example", "gasPayer": "", "homeUrl": "https://example.com", "imageUrl": "https://example.com", "internalName": "", "intervalCount": 0, "intervalUnit": "", "metadata": {}, "metricLimits": [], "metricMeteredCharge": [], "metricRecurringCharge": [], "multiCurrencies": [], "onetimeAddonIds": 0, "planId": 0, "planName": "", "productDescription": "", "productId": 0, "productName": "", "trialAmount": 0, "trialDemand": "", "trialDurationTime": 0, "usVATConfig": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/plan/edit" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "addonIds": [], "amount": 0, "cancelAtTrialEnd": 0, "currency": "", "description": "", "externalPlanId": "id_example", "gasPayer": "", "homeUrl": "https://example.com", "imageUrl": "https://example.com", "internalName": "", "intervalCount": 0, "intervalUnit": "", "metadata": {}, "metricLimits": [], "metricMeteredCharge": [], "metricRecurringCharge": [], "multiCurrencies": [], "onetimeAddonIds": 0, "planId": 0, "planName": "", "productDescription": "", "productId": 0, "productName": "", "trialAmount": 0, "trialDemand": "", "trialDurationTime": 0, "usVATConfig": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.plan` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Plan List Source: https://docs.unibee.dev/api-reference/plan/get-plan-list get /merchant/plan/list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/plan/list` Get Plan List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | -------------------- | ------- | -------- | ------------------------------------------------------------------------------------------------------ | | `planIds` | array | No | filter id list of plan, default all | | `productIds` | array | No | filter id list of product, default all product(0) used if not specified | | `type` | array | No | 1-main plan,2-addon plan,3-onetime | | `status` | array | No | Filter, Default All,,Status,1-Editing,2-Active,3-InActive,4-SoftArchive, 5-HardArchive | | `publishStatus` | integer | No | Filter, Default All,PublishStatus,1-UnPublished,2-Published | | `currency` | string | No | Filter Currency | | `intervalUnits` | array | No | Filter by interval unit (day\|week\|month\|year); ignored when billingIntervalMin is provided | | `intervalCounts` | array | No | Filter by interval count; ignored when billingIntervalMin is provided | | `billingIntervalMin` | string | No | Minimum billing interval in ISO 8601 duration (date part only, Y/M/W/D), e.g. P1M, P6M, P1Y, P2W, P10D | | `searchKey` | string | No | Search Key, plan name or description | | `sortField` | string | No | Sort Field,plan\_name\|gmt\_create\|gmt\_modify,Default gmt\_create | | `sortType` | string | No | Sort Type,asc\|desc,Default desc | | `page` | integer | No | Page, Start 0 | | `count` | integer | No | Count Of Per Page, Default 100 | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/plan/list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/plan/list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------ | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.plans` | array | Plans | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Plan List Source: https://docs.unibee.dev/api-reference/plan/get-plan-list-1 post /merchant/plan/list ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/plan/list` Get Plan List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | -------------------- | ------- | -------- | ------------------------------------------------------------------------------------------------------ | | `billingIntervalMin` | string | No | Minimum billing interval in ISO 8601 duration (date part only, Y/M/W/D), e.g. P1M, P6M, P1Y, P2W, P10D | | `count` | integer | No | Count Of Per Page, Default 100 | | `currency` | string | No | Filter Currency | | `intervalCounts` | array | No | Filter by interval count; ignored when billingIntervalMin is provided | | `intervalUnits` | array | No | Filter by interval unit (day\|week\|month\|year); ignored when billingIntervalMin is provided | | `page` | integer | No | Page, Start 0 | | `planIds` | array | No | filter id list of plan, default all | | `productIds` | array | No | filter id list of product, default all product(0) used if not specified | | `publishStatus` | integer | No | Filter, Default All,PublishStatus,1-UnPublished,2-Published | | `searchKey` | string | No | Search Key, plan name or description | | `sortField` | string | No | Sort Field,plan\_name\|gmt\_create\|gmt\_modify,Default gmt\_create | | `sortType` | string | No | Sort Type,asc\|desc,Default desc | | `status` | array | No | Filter, Default All,,Status,1-Editing,2-Active,3-InActive,4-SoftArchive, 5-HardArchive | | `type` | array | No | 1-main plan,2-addon plan,3-onetime | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/plan/list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "billingIntervalMin": "", "count": 0, "currency": "", "intervalCounts": [], "intervalUnits": [], "page": 0, "planIds": [], "productIds": [], "publishStatus": 0, "searchKey": "", "sortField": "", "sortType": "", "status": [], "type": [] }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/plan/list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "billingIntervalMin": "", "count": 0, "currency": "", "intervalCounts": [], "intervalUnits": [], "page": 0, "planIds": [], "productIds": [], "publishStatus": 0, "searchKey": "", "sortField": "", "sortType": "", "status": [], "type": [] }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------ | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.plans` | array | Plans | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Override Metric Limits Of Plan Source: https://docs.unibee.dev/api-reference/plan/override-metric-limits-of-plan post /merchant/plan/metric_limit_override Insert or override metric limit items of a plan ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/plan/metric_limit_override` Insert or override metric limit items of a plan *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------------ | ------- | -------- | ----------------------------------------------------------------------- | | `metadataOverride` | object | No | Metadata to override for plan, only provided keys will be added/updated | | `metricLimit` | array | No | MetricLimit items to insert or override, identify metric by id or code | | `planId` | integer | Yes | Id of plan | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/plan/metric_limit_override" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "metadataOverride": {}, "metricLimit": [], "planId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/plan/metric_limit_override" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "metadataOverride": {}, "metricLimit": [], "planId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------------------------- | ------- | ----------------------------------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.metadataOverrideSuccess` | boolean | Whether metadata override processed successfully | | `data.metricLimitOverrideSuccess` | boolean | Whether metric limits override processed successfully | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Plan Detail Source: https://docs.unibee.dev/api-reference/plan/plan-detail get /merchant/plan/detail ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/plan/detail` Plan Detail *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ---------------- | ------- | -------- | --------------------------------------------------------------------- | | `planId` | integer | No | The Id of plan, either planId or externalPlanId should be set | | `externalPlanId` | string | No | The ExternalId of plan, either externalPlanId or planId should be set | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/plan/detail" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/plan/detail" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.plan` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Plan Detail Source: https://docs.unibee.dev/api-reference/plan/plan-detail-1 post /merchant/plan/detail ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/plan/detail` Plan Detail *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------- | ------- | -------- | --------------------------------------------------------------------- | | `externalPlanId` | string | No | The ExternalId of plan, either externalPlanId or planId should be set | | `planId` | integer | No | The Id of plan, either planId or externalPlanId should be set | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/plan/detail" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalPlanId": "id_example", "planId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/plan/detail" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalPlanId": "id_example", "planId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.plan` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Preview Active Plan Price Change Source: https://docs.unibee.dev/api-reference/plan/preview-active-plan-price-change post /merchant/plan/active_price_change/preview Preview how many subscriptions will be affected if we change price of an active plan. ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/plan/active_price_change/preview` Preview how many subscriptions will be affected if we change price of an active plan. *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------- | ------- | -------- | -------------------------------------------------- | | `newAmount` | integer | Yes | New amount (in smallest currency unit, e.g. cents) | | `planId` | integer | Yes | Target planId, must be active | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/plan/active_price_change/preview" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "newAmount": 0, "planId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/plan/active_price_change/preview" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "newAmount": 0, "planId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ---------------------------------- | ------- | ------------------------------------------------------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.activeAffectedSubscriptions` | integer | Active/processing subscriptions whose future billing will be affected | | `data.newAmount` | integer | New amount of plan | | `data.oldAmount` | integer | Current amount of plan | | `data.planId` | integer | Target planId | | `data.totalAffectedSubscriptions` | integer | Total subscriptions that have used or are using this plan (by status set) | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Publish Plan Source: https://docs.unibee.dev/api-reference/plan/publish-plan post /merchant/plan/publish Publish plan,a plan will display at user portal when its published ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/plan/publish` Publish plan,a plan will display at user portal when its published *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------- | ------- | -------- | --------------------------------------------------------------------- | | `externalPlanId` | string | No | The ExternalId of plan, either externalPlanId or planId should be set | | `planId` | integer | No | The Id of plan, either planId or externalPlanId should be set | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/plan/publish" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalPlanId": "id_example", "planId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/plan/publish" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalPlanId": "id_example", "planId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # UnPublish Plan Source: https://docs.unibee.dev/api-reference/plan/unpublish-plan post /merchant/plan/unpublished ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/plan/unpublished` UnPublish Plan *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------- | ------- | -------- | --------------------------------------------------------------------- | | `externalPlanId` | string | No | The ExternalId of plan, either externalPlanId or planId should be set | | `planId` | integer | No | The Id of plan, either planId or externalPlanId should be set | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/plan/unpublished" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalPlanId": "id_example", "planId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/plan/unpublished" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalPlanId": "id_example", "planId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Activate Product Source: https://docs.unibee.dev/api-reference/product/activate-product post /merchant/product/activate ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/product/activate` Activate Product *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------- | ------- | -------- | ----------- | | `productId` | integer | Yes | ProductId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/product/activate" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "productId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/product/activate" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "productId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Copy Product Source: https://docs.unibee.dev/api-reference/product/copy-product post /merchant/product/copy ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/product/copy` Copy Product *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------- | ------- | -------- | ----------- | | `productId` | integer | Yes | ProductId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/product/copy" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "productId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/product/copy" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "productId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.product` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Create Product Source: https://docs.unibee.dev/api-reference/product/create-product post /merchant/product/new ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/product/new` Create Product *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------- | ------- | -------- | ------------------------------------------ | | `description` | string | No | description | | `homeUrl` | string | No | home\_url | | `imageUrl` | string | No | image\_url | | `metadata` | object | No | Metadata,Map | | `productName` | string | No | ProductName | | `status` | integer | No | status,1-active,2-inactive, default active | | `usVATConfig` | string | No | | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/product/new" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "description": "", "homeUrl": "https://example.com", "imageUrl": "https://example.com", "metadata": {}, "productName": "", "status": 0, "usVATConfig": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/product/new" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "description": "", "homeUrl": "https://example.com", "imageUrl": "https://example.com", "metadata": {}, "productName": "", "status": 0, "usVATConfig": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.product` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Delete Product Source: https://docs.unibee.dev/api-reference/product/delete-product post /merchant/product/delete Product can being deleted when has no plan linked ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/product/delete` Product can being deleted when has no plan linked *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------- | ------- | -------- | ----------- | | `productId` | integer | Yes | ProductId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/product/delete" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "productId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/product/delete" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "productId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Edit Product Source: https://docs.unibee.dev/api-reference/product/edit-product post /merchant/product/edit Edit exist product, product is editable for both active and inactive status ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/product/edit` Edit exist product, product is editable for both active and inactive status *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------- | ------- | -------- | ------------------------------------------ | | `description` | string | No | description | | `homeUrl` | string | No | home\_url | | `imageUrl` | string | No | image\_url | | `metadata` | object | No | Metadata,Map | | `productId` | integer | Yes | Id of product | | `productName` | string | No | ProductName | | `status` | integer | No | status,1-active,2-inactive, default active | | `usVATConfig` | string | No | | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/product/edit" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "description": "", "homeUrl": "https://example.com", "imageUrl": "https://example.com", "metadata": {}, "productId": 0, "productName": "", "status": 0, "usVATConfig": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/product/edit" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "description": "", "homeUrl": "https://example.com", "imageUrl": "https://example.com", "metadata": {}, "productId": 0, "productName": "", "status": 0, "usVATConfig": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.product` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Product List Source: https://docs.unibee.dev/api-reference/product/get-product-list get /merchant/product/list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/product/list` Get Product List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ----------- | ------- | -------- | --------------------------------------------------- | | `status` | array | No | Filter, Default All,,Status,1-active,2-inactive | | `sortField` | string | No | Sort Field,id\|create\_time\|gmt\_modify,Default id | | `sortType` | string | No | Sort Type,asc\|desc,Default desc | | `page` | integer | No | Page, Start 0 | | `count` | integer | No | Count Of Per Page | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/product/list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/product/list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.products` | array | Product Object List | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Product List Source: https://docs.unibee.dev/api-reference/product/get-product-list-1 post /merchant/product/list ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/product/list` Get Product List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------- | ------- | -------- | --------------------------------------------------- | | `count` | integer | No | Count Of Per Page | | `page` | integer | No | Page, Start 0 | | `sortField` | string | No | Sort Field,id\|create\_time\|gmt\_modify,Default id | | `sortType` | string | No | Sort Type,asc\|desc,Default desc | | `status` | array | No | Filter, Default All,,Status,1-active,2-inactive | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/product/list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "count": 0, "page": 0, "sortField": "", "sortType": "", "status": [] }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/product/list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "count": 0, "page": 0, "sortField": "", "sortType": "", "status": [] }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.products` | array | Product Object List | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Inactivate Product Source: https://docs.unibee.dev/api-reference/product/inactivate-product post /merchant/product/inactivate ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/product/inactivate` Inactivate Product *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------- | ------- | -------- | ----------- | | `productId` | integer | Yes | ProductId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/product/inactivate" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "productId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/product/inactivate" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "productId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Product Detail Source: https://docs.unibee.dev/api-reference/product/product-detail get /merchant/product/detail ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/product/detail` Product Detail *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ----------- | ------- | -------- | ----------- | | `productId` | integer | Yes | ProductId | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/product/detail" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/product/detail" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.product` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Product Detail Source: https://docs.unibee.dev/api-reference/product/product-detail-1 post /merchant/product/detail ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/product/detail` Product Detail *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------- | ------- | -------- | ----------- | | `productId` | integer | Yes | ProductId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/product/detail" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "productId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/product/detail" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "productId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.product` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Edit Promo Credit Config Source: https://docs.unibee.dev/api-reference/promo-credit/edit-promo-credit-config post /merchant/credit/edit_promo_config ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/credit/edit_promo_config` Edit Promo Credit Config *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------------------- | ------- | -------- | ------------------------------------------------------------------------------------------------------------------ | | `currency` | string | Yes | currency | | `description` | string | No | description | | `discountCodeExclusive` | integer | No | discount code exclusive when purchase, default no, 0-no, 1-yes | | `exchangeRate` | integer | No | keep two decimal places,scale = 100, 1 currency = 1 credit \* (exchange\_rate/100), main account fixed rate to 100 | | `logo` | string | No | logo image base64, show when user purchase | | `logoUrl` | string | No | logo url, show when user purchase | | `metaData` | object | No | meta\_data(json) | | `name` | string | No | name | | `payoutEnable` | integer | No | credit account can payout or not, default no, 0-no, 1-yes | | `previewDefaultUsed` | integer | No | is default used when in purchase preview, default no, 0-no, 1-yes | | `rechargeEnable` | integer | No | credit account can be recharged or not, 0-no, 1-yes | | `recurring` | integer | No | apply to recurring, default no, 0-no,1-yes | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/credit/edit_promo_config" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "currency": "", "description": "", "discountCodeExclusive": 0, "exchangeRate": 0, "logo": "", "logoUrl": "https://example.com", "metaData": {}, "name": "", "payoutEnable": 0, "previewDefaultUsed": 0, "rechargeEnable": 0, "recurring": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/credit/edit_promo_config" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "currency": "", "description": "", "discountCodeExclusive": 0, "exchangeRate": 0, "logo": "", "logoUrl": "https://example.com", "metaData": {}, "name": "", "payoutEnable": 0, "previewDefaultUsed": 0, "rechargeEnable": 0, "recurring": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.creditConfig` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Promo Credit Config Source: https://docs.unibee.dev/api-reference/promo-credit/get-promo-credit-config get /merchant/credit/get_promo_config ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/credit/get_promo_config` Get Promo Credit Config *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ---------- | ------ | -------- | ----------- | | `currency` | string | No | currency | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/credit/get_promo_config" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/credit/get_promo_config" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.creditConfig` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Promo Credit Config Source: https://docs.unibee.dev/api-reference/promo-credit/get-promo-credit-config-1 post /merchant/credit/get_promo_config ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/credit/get_promo_config` Get Promo Credit Config *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------- | ------ | -------- | ----------- | | `currency` | string | No | currency | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/credit/get_promo_config" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "currency": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/credit/get_promo_config" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "currency": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.creditConfig` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Promo Credit Config Statistics Source: https://docs.unibee.dev/api-reference/promo-credit/get-promo-credit-config-statistics get /merchant/credit/get_promo_config_statistics ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/credit/get_promo_config_statistics` Get Promo Credit Config Statistics *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ---------- | ------ | -------- | ----------- | | `currency` | string | No | currency | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/credit/get_promo_config_statistics" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/credit/get_promo_config_statistics" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.creditConfigStatistics` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Promo Credit Config Statistics Source: https://docs.unibee.dev/api-reference/promo-credit/get-promo-credit-config-statistics-1 post /merchant/credit/get_promo_config_statistics ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/credit/get_promo_config_statistics` Get Promo Credit Config Statistics *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------- | ------ | -------- | ----------- | | `currency` | string | No | currency | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/credit/get_promo_config_statistics" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "currency": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/credit/get_promo_config_statistics" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "currency": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.creditConfigStatistics` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Promo Credit Decrement Source: https://docs.unibee.dev/api-reference/promo-credit/promo-credit-decrement post /merchant/credit/promo_credit_decrement Decrease user promo credit amount, the amount after decreased should greater than 0 ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/credit/promo_credit_decrement` Decrease user promo credit amount, the amount after decreased should greater than 0 *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------- | ------- | -------- | --------------------------------------------- | | `amount` | integer | Yes | The Amount to decrease, should greater than 0 | | `currency` | string | Yes | currency of recharge | | `description` | string | No | description of increase action | | `name` | string | No | name of increase action | | `userId` | integer | Yes | filter id of user | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/credit/promo_credit_decrement" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "amount": 0, "currency": "", "description": "", "name": "", "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/credit/promo_credit_decrement" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "amount": 0, "currency": "", "description": "", "name": "", "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.UserPromoCreditAccount` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Promo Credit Increment Source: https://docs.unibee.dev/api-reference/promo-credit/promo-credit-increment post /merchant/credit/promo_credit_increment Increase user promo credit amount ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/credit/promo_credit_increment` Increase user promo credit amount *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------- | ------- | -------- | --------------------------------------------- | | `amount` | integer | Yes | The amount to increase, should greater than 0 | | `currency` | string | Yes | currency of recharge | | `description` | string | No | description of increase action | | `name` | string | No | name of increase action | | `userId` | integer | Yes | filter id of user | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/credit/promo_credit_increment" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "amount": 0, "currency": "", "description": "", "name": "", "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/credit/promo_credit_increment" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "amount": 0, "currency": "", "description": "", "name": "", "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.UserPromoCreditAccount` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Promo Credit Refund Source: https://docs.unibee.dev/api-reference/promo-credit/promo-credit-refund post /merchant/credit/promo_credit_refund_from_invoice Refund user promo credit amount from refund invoice ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/credit/promo_credit_refund_from_invoice` Refund user promo credit amount from refund invoice *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------- | ------ | -------- | ----------- | | `invoiceId` | string | Yes | invoice id | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/credit/promo_credit_refund_from_invoice" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceId": "id_example" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/credit/promo_credit_refund_from_invoice" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceId": "id_example" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Search Source: https://docs.unibee.dev/api-reference/search/search get /merchant/search/key_search ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/search/key_search` Search *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ----------- | ------ | -------- | -------------------------------------------------------------------------------------------------------------- | | `searchKey` | string | No | SearchKey, Will Search UserId\|Email\|UserName\|CompanyName\|SubscriptionId\|VatNumber\|InvoiceId\|\|PaymentId | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/search/key_search" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/search/key_search" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.matchInvoice` | array | MatchInvoice | | `data.matchUserAccounts` | array | MatchUserAccounts | | `data.precisionMatchObject` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Search Source: https://docs.unibee.dev/api-reference/search/search-1 post /merchant/search/key_search ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/search/key_search` Search *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------- | ------ | -------- | -------------------------------------------------------------------------------------------------------------- | | `searchKey` | string | No | SearchKey, Will Search UserId\|Email\|UserName\|CompanyName\|SubscriptionId\|VatNumber\|InvoiceId\|\|PaymentId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/search/key_search" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "searchKey": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/search/key_search" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "searchKey": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.matchInvoice` | array | MatchInvoice | | `data.matchUserAccounts` | array | MatchUserAccounts | | `data.precisionMatchObject` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Customer Portal Url Source: https://docs.unibee.dev/api-reference/session/get-customer-portal-url get /merchant/session/customer_portal_url ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/session/customer_portal_url` Get Customer Portal Url *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ---------------- | ------- | -------- | --------------------------------------------------------------------- | | `email` | string | No | Email, unique, either ExternalUserId\&Email or UserId needed | | `userId` | integer | No | UserId, unique, either ExternalUserId\&Email or UserId needed | | `externalUserId` | string | No | ExternalUserId, unique, either ExternalUserId\&Email or UserId needed | | `productId` | integer | No | Id of product, default product will use if productId not specified | | `planId` | integer | No | Id of plan to update | | `vatCountryCode` | string | No | Vat Country Code | | `returnUrl` | string | No | ReturnUrl | | `cancelUrl` | string | No | CancelUrl | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/session/customer_portal_url" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/session/customer_portal_url" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.url` | string | Url | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Customer Portal Url Source: https://docs.unibee.dev/api-reference/session/get-customer-portal-url-1 post /merchant/session/customer_portal_url ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/session/customer_portal_url` Get Customer Portal Url *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------- | ------- | -------- | --------------------------------------------------------------------- | | `cancelUrl` | string | No | CancelUrl | | `email` | string | No | Email, unique, either ExternalUserId\&Email or UserId needed | | `externalUserId` | string | No | ExternalUserId, unique, either ExternalUserId\&Email or UserId needed | | `planId` | integer | No | Id of plan to update | | `productId` | integer | No | Id of product, default product will use if productId not specified | | `returnUrl` | string | No | ReturnUrl | | `userId` | integer | No | UserId, unique, either ExternalUserId\&Email or UserId needed | | `vatCountryCode` | string | No | Vat Country Code | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/session/customer_portal_url" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "cancelUrl": "https://example.com", "email": "user@example.com", "externalUserId": "id_example", "planId": 0, "productId": 0, "returnUrl": "https://example.com", "userId": 0, "vatCountryCode": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/session/customer_portal_url" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "cancelUrl": "https://example.com", "email": "user@example.com", "externalUserId": "id_example", "planId": 0, "productId": 0, "returnUrl": "https://example.com", "userId": 0, "vatCountryCode": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.url` | string | Url | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get User Subscription Update Page Url Source: https://docs.unibee.dev/api-reference/session/get-user-subscription-update-page-url get /merchant/session/user_sub_update_url ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/session/user_sub_update_url` Get User Subscription Update Page Url *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ---------------- | ------- | -------- | --------------------------------------------------------------------- | | `email` | string | No | Email, unique, either ExternalUserId\&Email or UserId needed | | `userId` | integer | No | UserId, unique, either ExternalUserId\&Email or UserId needed | | `externalUserId` | string | No | ExternalUserId, unique, either ExternalUserId\&Email or UserId needed | | `productId` | integer | No | Id of product,default product will use if productId not specified | | `planId` | integer | No | Id of plan to update | | `vatCountryCode` | string | No | Vat Country Code | | `returnUrl` | string | No | ReturnUrl | | `cancelUrl` | string | No | CancelUrl | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/session/user_sub_update_url" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/session/user_sub_update_url" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.url` | string | Url | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get User Subscription Update Page Url Source: https://docs.unibee.dev/api-reference/session/get-user-subscription-update-page-url-1 post /merchant/session/user_sub_update_url ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/session/user_sub_update_url` Get User Subscription Update Page Url *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------- | ------- | -------- | --------------------------------------------------------------------- | | `cancelUrl` | string | No | CancelUrl | | `email` | string | No | Email, unique, either ExternalUserId\&Email or UserId needed | | `externalUserId` | string | No | ExternalUserId, unique, either ExternalUserId\&Email or UserId needed | | `planId` | integer | No | Id of plan to update | | `productId` | integer | No | Id of product,default product will use if productId not specified | | `returnUrl` | string | No | ReturnUrl | | `userId` | integer | No | UserId, unique, either ExternalUserId\&Email or UserId needed | | `vatCountryCode` | string | No | Vat Country Code | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/session/user_sub_update_url" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "cancelUrl": "https://example.com", "email": "user@example.com", "externalUserId": "id_example", "planId": 0, "productId": 0, "returnUrl": "https://example.com", "userId": 0, "vatCountryCode": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/session/user_sub_update_url" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "cancelUrl": "https://example.com", "email": "user@example.com", "externalUserId": "id_example", "planId": 0, "productId": 0, "returnUrl": "https://example.com", "userId": 0, "vatCountryCode": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.url` | string | Url | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # New Checkout Session Source: https://docs.unibee.dev/api-reference/session/new-checkout-session post /merchant/session/new_session New session for hosted checkout or client portal. You can create user and get ClientSession from here, then append it to the checkout link (copied from Admin Portal Plan) as a query parameter, e.g. https://cs.unibee.dev/hosted/checkout?planId=253&env=prod&session=${clientSession} ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/session/new_session` New session for hosted checkout or client portal. You can create user and get ClientSession from here, then append it to the checkout link (copied from Admin Portal Plan) as a query parameter, e.g. [https://cs.unibee.dev/hosted/checkout?planId=253\&env=prod\&session=\$\{clientSession}](https://cs.unibee.dev/hosted/checkout?planId=253\&env=prod\&session=\$\{clientSession}) *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------- | ------ | -------- | -------------------------------------------------- | | `address` | string | No | Address | | `cancelUrl` | string | No | CancelUrl, back to cancelUrl if checkout cancelled | | `email` | string | Yes | Email | | `externalUserId` | string | No | ExternalUserId | | `firstName` | string | No | First Name | | `lastName` | string | No | Last Name | | `password` | string | No | Password | | `phone` | string | No | Phone | | `returnUrl` | string | No | ReturnUrl, back to returnUrl if checkout completed | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/session/new_session" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "address": "", "cancelUrl": "https://example.com", "email": "user@example.com", "externalUserId": "id_example", "firstName": "", "lastName": "", "password": "", "phone": "", "returnUrl": "https://example.com" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/session/new_session" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "address": "", "cancelUrl": "https://example.com", "email": "user@example.com", "externalUserId": "id_example", "firstName": "", "lastName": "", "password": "", "phone": "", "returnUrl": "https://example.com" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.clientSession` | string | ClientSession | | `data.clientToken` | string | ClientToken | | `data.email` | string | Email | | `data.externalUserId` | string | ExternalUserId | | `data.url` | string | Url | | `data.userId` | string | UserId | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Subscription Config Source: https://docs.unibee.dev/api-reference/subscription-config/subscription-config get /merchant/subscription/config ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/subscription/config` Subscription Config *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/subscription/config" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/subscription/config" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.config` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Update Merchant Subscription Config Source: https://docs.unibee.dev/api-reference/subscription-config/update-merchant-subscription-config post /merchant/subscription/config/update ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/subscription/config/update` Update Merchant Subscription Config *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------------------------------------- | ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | | `downgradeEffectImmediately` | boolean | No | DowngradeEffectImmediately, Immediate Downgrade (by default, the downgrades takes effect at the end of the period ) | | `downgradeNonImmediatelyEffectBeforePeriodEnd` | integer | No | DowngradeNonImmediatelyEffectBeforePeriodEnd, seconds, For non-immediate downgrade, can take effect before period end (default 30 minutes, 1800 seconds) | | `gatewayVATRule` | array | No | | | `incompleteExpireTime` | integer | No | IncompleteExpireTime, seconds, Incomplete Status Duration(The period during which subscription remains in | | `invoiceEmail` | boolean | No | InvoiceEmail, Enable Invoice Email (Toggle to send invoice email to customers) | | `showZeroInvoice` | boolean | No | ShowZeroInvoice, Display Invoices With Zero Amount (Invoice With Zero Amount will hidden in list by default) | | `tryAutomaticPaymentBeforePeriodEnd` | integer | No | TryAutomaticPaymentBeforePeriodEnd, Auto-charge Start Before Period End (Time Difference for Auto-Payment Activation Before Period End) | | `upgradeProration` | boolean | No | UpgradeProration, Prorated Upgrade Invoices(Upgrades will generate prorated invoice by default) | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/subscription/config/update" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "downgradeEffectImmediately": false, "downgradeNonImmediatelyEffectBeforePeriodEnd": 0, "gatewayVATRule": [], "incompleteExpireTime": 0, "invoiceEmail": "user@example.com", "showZeroInvoice": false, "tryAutomaticPaymentBeforePeriodEnd": 0, "upgradeProration": false }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/subscription/config/update" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "downgradeEffectImmediately": false, "downgradeNonImmediatelyEffectBeforePeriodEnd": 0, "gatewayVATRule": [], "incompleteExpireTime": 0, "invoiceEmail": "user@example.com", "showZeroInvoice": false, "tryAutomaticPaymentBeforePeriodEnd": 0, "upgradeProration": false }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.config` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Active Subscription Import(allows repetition imports) Source: https://docs.unibee.dev/api-reference/subscription-import/active-subscription-importallows-repetition-imports post /merchant/subscription/active_subscription_import Each repetition import overrides existing subscriptions with matching ExternalSubscriptionId. ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/subscription/active_subscription_import` Each repetition import overrides existing subscriptions with matching ExternalSubscriptionId. *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------------------ | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `StripePaymentMethod` | string | No | The stripe payment method id which user attached, get from stripe, required if stripe auto-charge needed | | `StripeUserId` | string | No | The stripe customer id of user get from stripe, required if stripe auto-charge needed | | `billingCycleAnchor` | string | No | Required, UTC time, The reference point that aligns future billing cycle dates. It sets the day of week for week intervals, the day of month for month and year intervals, and the month of year for year intervals, format '2006-01-02 15:04:05' | | `countryCode` | string | No | Required. Specifies the ISO 3166-1 alpha-2 country code for the subscription (e.g., EE, RU). This code determines the applicable tax rules for the subscription. | | `createTime` | string | No | Required, UTC time, the creation time of subscription, format '2006-01-02 15:04:05' | | `currentPeriodEnd` | string | No | Required, UTC time, the current period end time of subscription, format '2006-01-02 15:04:05' | | `currentPeriodStart` | string | No | Required, UTC time, the current period start time of subscription, format '2006-01-02 15:04:05' | | `discount` | string | No | | | `email` | string | No | The email of user, one of Email or ExternalUserId is required | | `expectedTotalAmount` | integer | No | Optional. Unit: cents. If greater than 0, the system will verify the calculated total amount against this value | | `externalPlanId` | string | No | The external id of plan, one of planId or ExternalPlanId is required, plan should created at UniBee at first | | `externalSubscriptionId` | string | No | Required, The external id of subscription | | `externalUserId` | string | No | The external id of user, one of Email or ExternalUserId is required | | `features` | string | No | In json format, additional features data of subscription, will join user's metric data in user api if provided' | | `firstPaidTime` | string | No | UTC time, the first payment success time of subscription, format '2006-01-02 15:04:05' | | `gateway` | string | No | Required, should one of stripe\|paypal\|wire\_transfer\|changelly | | `gatewayPaymentType` | string | No | | | `metadata` | object | No | Metadata,Map | | `paypalAgreementToken` | string | No | The billing agreement token of user payment method while billing agreement reference transaction enabled, required if paypal auto-charge needed | | `paypalVaultId` | string | No | The paypal vault id of user payment method, get from paypal while vault permission enabled, required if paypal auto-charge needed | | `planId` | integer | No | The id of plan, one of planId or ExternalPlanId is required, plan should created at UniBee at first | | `quantity` | integer | No | the quantity of plan, default 1 if not provided | | `taxPercentage` | integer | No | The tax percentage. Only applicable when the system VAT gateway not setup. Value is in thousandths (e.g., 1000 = 10%). | | `vatNumber` | string | No | The Vat Number of user | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/subscription/active_subscription_import" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "StripePaymentMethod": "", "StripeUserId": "id_example", "billingCycleAnchor": "", "countryCode": "", "createTime": 0, "currentPeriodEnd": "", "currentPeriodStart": "", "discount": "", "email": "user@example.com", "expectedTotalAmount": 0, "externalPlanId": "id_example", "externalSubscriptionId": "id_example", "externalUserId": "id_example", "features": "", "firstPaidTime": "id_example", "gateway": "", "gatewayPaymentType": "", "metadata": {}, "paypalAgreementToken": "", "paypalVaultId": "id_example", "planId": 0, "quantity": 0, "taxPercentage": 0, "vatNumber": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/subscription/active_subscription_import" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "StripePaymentMethod": "", "StripeUserId": "id_example", "billingCycleAnchor": "", "countryCode": "", "createTime": 0, "currentPeriodEnd": "", "currentPeriodStart": "", "discount": "", "email": "user@example.com", "expectedTotalAmount": 0, "externalPlanId": "id_example", "externalSubscriptionId": "id_example", "externalUserId": "id_example", "features": "", "firstPaidTime": "id_example", "gateway": "", "gatewayPaymentType": "", "metadata": {}, "paypalAgreementToken": "", "paypalVaultId": "id_example", "planId": 0, "quantity": 0, "taxPercentage": 0, "vatNumber": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.subscription` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # History Subscription Import(Allows repetition imports) Source: https://docs.unibee.dev/api-reference/subscription-import/history-subscription-importallows-repetition-imports post /merchant/subscription/history_subscription_import Each repetition import overrides existing subscriptions with matching ExternalSubscriptionId. ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/subscription/history_subscription_import` Each repetition import overrides existing subscriptions with matching ExternalSubscriptionId. *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------------------ | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `countryCode` | string | No | Required. Specifies the ISO 3166-1 alpha-2 country code for the subscription (e.g., EE, RU). This code determines the applicable tax rules for the subscription. | | `currentPeriodEnd` | string | No | Required, UTC time, the current period end time of subscription, format '2006-01-02 15:04:05' | | `currentPeriodStart` | string | No | Required, UTC time, the current period start time of subscription, format '2006-01-02 15:04:05' | | `email` | string | No | The email of user, one of Email or ExternalUserId is required | | `externalPlanId` | string | No | The external id of plan, one of planId or ExternalPlanId is required, plan should created at UniBee at first | | `externalSubscriptionId` | string | No | Required, The external id of subscription | | `externalUserId` | string | No | The external id of user, one of Email or ExternalUserId is required | | `gateway` | string | No | Required, should one of stripe\|paypal\|wire\_transfer\|changelly | | `gatewayPaymentType` | string | No | | | `metadata` | object | No | Metadata,Map | | `planId` | integer | No | The id of plan, one of planId or ExternalPlanId is required, plan should created at UniBee at first | | `quantity` | integer | No | the quantity of plan, default 1 if not provided | | `taxPercentage` | integer | No | The TaxPercentage of subscription, Only applicable when the system VAT gateway not setup, 1000 = 10% | | `totalAmount` | integer | No | Required. The total subscription amount including tax, unit in cents. Recommendation: Please provide the original price (amount with tax before any discounts) to maintain data consistency. Note: The system will not validate this amount against the plan price, as external billing systems may have different calculation logic. | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/subscription/history_subscription_import" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "countryCode": "", "currentPeriodEnd": "", "currentPeriodStart": "", "email": "user@example.com", "externalPlanId": "id_example", "externalSubscriptionId": "id_example", "externalUserId": "id_example", "gateway": "", "gatewayPaymentType": "", "metadata": {}, "planId": 0, "quantity": 0, "taxPercentage": 0, "totalAmount": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/subscription/history_subscription_import" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "countryCode": "", "currentPeriodEnd": "", "currentPeriodStart": "", "email": "user@example.com", "externalPlanId": "id_example", "externalSubscriptionId": "id_example", "externalUserId": "id_example", "gateway": "", "gatewayPaymentType": "", "metadata": {}, "planId": 0, "quantity": 0, "taxPercentage": 0, "totalAmount": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.subscription` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Subscription Note List Source: https://docs.unibee.dev/api-reference/subscription-note/get-subscription-note-list get /merchant/subscription/admin_note_list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/subscription/admin_note_list` Get Subscription Note List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ---------------- | ------- | -------- | ------------------ | | `subscriptionId` | string | Yes | SubscriptionId | | `page` | integer | No | Page, Start With 0 | | `count` | integer | No | Count Of Page | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/subscription/admin_note_list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/subscription/admin_note_list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ---------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.noteLists` | array | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Subscription Note List Source: https://docs.unibee.dev/api-reference/subscription-note/get-subscription-note-list-1 post /merchant/subscription/admin_note_list ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/subscription/admin_note_list` Get Subscription Note List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------- | ------- | -------- | ------------------ | | `count` | integer | No | Count Of Page | | `page` | integer | No | Page, Start With 0 | | `subscriptionId` | string | Yes | SubscriptionId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/subscription/admin_note_list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "count": 0, "page": 0, "subscriptionId": "id_example" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/subscription/admin_note_list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "count": 0, "page": 0, "subscriptionId": "id_example" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ---------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.noteLists` | array | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # New Subscription Note Source: https://docs.unibee.dev/api-reference/subscription-note/new-subscription-note post /merchant/subscription/new_admin_note ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/subscription/new_admin_note` New Subscription Note *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------- | ------ | -------- | -------------- | | `note` | string | Yes | Note | | `subscriptionId` | string | Yes | SubscriptionId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/subscription/new_admin_note" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "note": "", "subscriptionId": "id_example" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/subscription/new_admin_note" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "note": "", "subscriptionId": "id_example" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Subscription Onetime Addon Purchase History List Source: https://docs.unibee.dev/api-reference/subscription-payment/get-subscription-onetime-addon-purchase-history-list get /merchant/subscription/onetime_addon_purchase_list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/subscription/onetime_addon_purchase_list` Get Subscription Onetime Addon Purchase History List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ----------------- | ------- | -------- | -------------------------------------------------------------- | | `userId` | integer | Yes | UserId | | `subscriptionIds` | array | No | Filter SubscriptionIds, Default All | | `addonIds` | array | No | Filter AddonIds, Default All | | `status` | array | No | Filter Status, Default All,1-Create|2-Paid|3-Cancel|4-Expired | | `createTimeStart` | integer | No | CreateTimeStart,UTC timestamp,seconds | | `createTimeEnd` | integer | No | CreateTimeEnd,UTC timestamp,seconds | | `periodStart` | integer | No | PeriodStart,addon effective period start,UTC timestamp,seconds | | `periodEnd` | integer | No | PeriodEnd,addon effective period end,UTC timestamp,seconds | | `page` | integer | No | Page, Start With 0 | | `count` | integer | No | Count Of Page | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/subscription/onetime_addon_purchase_list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/subscription/onetime_addon_purchase_list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.subscriptionOnetimeAddons` | array | SubscriptionOnetimeAddons | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # New Subscription Onetime Addon Payment Source: https://docs.unibee.dev/api-reference/subscription-payment/new-subscription-onetime-addon-payment post /merchant/subscription/new_onetime_addon_payment Create payment for subscription onetime addon purchase ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/subscription/new_onetime_addon_payment` Create payment for subscription onetime addon purchase *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------------------ | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `addonId` | integer | Yes | AddonId, id of one-time addon, the new payment will created base on the addon's amount' | | `applyPromoCredit` | boolean | No | apply promo credit or not | | `applyPromoCreditAmount` | integer | No | apply promo credit amount, auto compute if not specified | | `cancelUrl` | string | No | CancelUrl, back to cancelUrl if user cancel the payment | | `currency` | string | No | The currency of payment | | `discountAmount` | integer | No | Amount of discount | | `discountCode` | string | No | DiscountCode | | `discountPercentage` | integer | No | Percentage of discount, 100=1%, ignore if discountAmount specified | | `gatewayId` | integer | No | GatewayId, use user's gateway if not provide | | `gatewayPaymentType` | string | No | Gateway Payment Type | | `metadata` | object | No | Metadata,custom data | | `quantity` | integer | Yes | Quantity, quantity of the new payment which one-time addon purchased | | `returnUrl` | string | No | ReturnUrl, the addon's payment will redirect based on the returnUrl provided when it's back from gateway side | | `subscriptionId` | string | No | SubscriptionId, id of subscription which addon will attached, either SubscriptionId or UserId needed, The only one active subscription of userId will attach the addon | | `taxPercentage` | integer | No | TaxPercentage,1000 = 10%, default user's taxPercentage if not specified | | `userId` | integer | No | UserId, either SubscriptionId or UserId needed, The only one active subscription will update if userId provide instead of subscriptionId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/subscription/new_onetime_addon_payment" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "addonId": 0, "applyPromoCredit": false, "applyPromoCreditAmount": 0, "cancelUrl": "https://example.com", "currency": "", "discountAmount": 0, "discountCode": "", "discountPercentage": 0, "gatewayId": 0, "gatewayPaymentType": "", "metadata": {}, "quantity": 0, "returnUrl": "https://example.com", "subscriptionId": "id_example", "taxPercentage": 0, "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/subscription/new_onetime_addon_payment" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "addonId": 0, "applyPromoCredit": false, "applyPromoCreditAmount": 0, "cancelUrl": "https://example.com", "currency": "", "discountAmount": 0, "discountCode": "", "discountPercentage": 0, "gatewayId": 0, "gatewayPaymentType": "", "metadata": {}, "quantity": 0, "returnUrl": "https://example.com", "subscriptionId": "id_example", "taxPercentage": 0, "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.invoice` | object | | | `data.link` | string | if automatic payment is false, Gateway Link will provided that manual payment needed | | `data.paid` | boolean | true\|false,automatic payment is default behavior for one-time addon purchased, payment will create attach to the purchase, when payment is success, return false, otherwise false | | `data.subscriptionOnetimeAddon` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # New Subscription Onetime Addon Preview Source: https://docs.unibee.dev/api-reference/subscription-payment/new-subscription-onetime-addon-preview post /merchant/subscription/new_onetime_addon_preview Preview for subscription onetime addon purchase ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/subscription/new_onetime_addon_preview` Preview for subscription onetime addon purchase *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------------------ | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `addonId` | integer | Yes | AddonId, id of one-time addon, the new payment will created base on the addon's amount' | | `applyPromoCredit` | boolean | No | apply promo credit or not | | `applyPromoCreditAmount` | integer | No | apply promo credit amount, auto compute if not specified | | `currency` | string | No | The currency of payment | | `discountAmount` | integer | No | Amount of discount | | `discountCode` | string | No | DiscountCode | | `discountPercentage` | integer | No | Percentage of discount, 100=1%, ignore if discountAmount specified | | `gatewayId` | integer | No | GatewayId, use user's gateway if not provide | | `gatewayPaymentType` | string | No | Gateway Payment Type | | `metadata` | object | No | Metadata,custom data | | `quantity` | integer | Yes | Quantity, quantity of the new payment which one-time addon purchased | | `subscriptionId` | string | No | SubscriptionId, id of subscription which addon will attached, either SubscriptionId or UserId needed, The only one active subscription of userId will attach the addon | | `taxPercentage` | integer | No | TaxPercentage,1000 = 10%, default user's taxPercentage if not specified | | `userId` | integer | No | UserId, either SubscriptionId or UserId needed, The only one active subscription will update if userId provide instead of subscriptionId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/subscription/new_onetime_addon_preview" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "addonId": 0, "applyPromoCredit": false, "applyPromoCreditAmount": 0, "currency": "", "discountAmount": 0, "discountCode": "", "discountPercentage": 0, "gatewayId": 0, "gatewayPaymentType": "", "metadata": {}, "quantity": 0, "subscriptionId": "id_example", "taxPercentage": 0, "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/subscription/new_onetime_addon_preview" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "addonId": 0, "applyPromoCredit": false, "applyPromoCreditAmount": 0, "currency": "", "discountAmount": 0, "discountCode": "", "discountPercentage": 0, "gatewayId": 0, "gatewayPaymentType": "", "metadata": {}, "quantity": 0, "subscriptionId": "id_example", "taxPercentage": 0, "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.addon` | object | | | `data.applyPromoCredit` | boolean | apply promo credit or not | | `data.currency` | string | | | `data.discount` | object | | | `data.discountAmount` | integer | | | `data.discountMessage` | string | | | `data.email` | string | | | `data.invoice` | object | | | `data.originAmount` | integer | | | `data.quantity` | integer | | | `data.taxAmount` | integer | | | `data.taxPercentage` | integer | | | `data.totalAmount` | integer | | | `data.userId` | integer | | | `data.vatNumber` | string | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # New Subscription Payment Source: https://docs.unibee.dev/api-reference/subscription-payment/new-subscription-payment post /merchant/subscription/payment/new ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/subscription/payment/new` New Subscription Payment *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------------- | ------- | -------- | ------------------------------------------------------------------------ | | `cancelUrl` | string | No | CancelUrl | | `countryCode` | string | No | CountryCode | | `currency` | string | No | Currency, either Currency\&TotalAmount or PlanId needed | | `description` | string | No | Description | | `email` | string | No | Email, either ExternalUserId\&Email or UserId needed | | `externalPaymentId` | string | No | ExternalPaymentId should unique for payment | | `externalUserId` | string | No | ExternalUserId, unique, either ExternalUserId\&Email or UserId needed | | `gasPayer` | string | No | who pay the gas, merchant\|user | | `gatewayId` | integer | Yes | GatewayId | | `items` | array | No | Items | | `metadata` | object | No | Metadata,Map | | `name` | string | No | Name | | `planId` | integer | No | PlanId, either TotalAmount\&Currency or PlanId needed | | `redirectUrl` | string | No | Redirect Url | | `totalAmount` | integer | No | Total PaymentAmount, Cent, either TotalAmount\&Currency or PlanId needed | | `userId` | integer | No | UserId, either ExternalUserId\&Email or UserId needed | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/subscription/payment/new" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "cancelUrl": "https://example.com", "countryCode": "", "currency": "", "description": "", "email": "user@example.com", "externalPaymentId": "id_example", "externalUserId": "id_example", "gasPayer": "", "gatewayId": 0, "items": [], "metadata": {}, "name": "", "planId": 0, "redirectUrl": "https://example.com", "totalAmount": 0, "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/subscription/payment/new" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "cancelUrl": "https://example.com", "countryCode": "", "currency": "", "description": "", "email": "user@example.com", "externalPaymentId": "id_example", "externalUserId": "id_example", "gasPayer": "", "gatewayId": 0, "items": [], "metadata": {}, "name": "", "planId": 0, "redirectUrl": "https://example.com", "totalAmount": 0, "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------------ | ------- | ------------------------------------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.action` | object | | | `data.externalPaymentId` | string | The external unique id of payment | | `data.link` | string | | | `data.paymentId` | string | The unique id of payment | | `data.status` | integer | Status, 10-Created\|20-Success\|30-Failed\|40-Cancelled | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Subscription TimeLine List Source: https://docs.unibee.dev/api-reference/subscription-timeline/get-subscription-timeline-list get /merchant/subscription/timeline_list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/subscription/timeline_list` Get Subscription TimeLine List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ----------- | ------- | -------- | ------------------------------------------------------- | | `userId` | integer | No | Filter UserId, Default All | | `sortField` | string | No | Sort Field,gmt\_create\|gmt\_modify,Default gmt\_modify | | `sortType` | string | No | Sort Type,asc\|desc,Default desc | | `page` | integer | No | Page, Start With 0 | | `count` | integer | No | Count Of Page | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/subscription/timeline_list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/subscription/timeline_list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ---------------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.subscriptionTimeLines` | array | SubscriptionTimeLines | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Subscription TimeLine List Source: https://docs.unibee.dev/api-reference/subscription-timeline/get-subscription-timeline-list-1 post /merchant/subscription/timeline_list ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/subscription/timeline_list` Get Subscription TimeLine List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------- | ------- | -------- | ------------------------------------------------------- | | `count` | integer | No | Count Of Page | | `page` | integer | No | Page, Start With 0 | | `sortField` | string | No | Sort Field,gmt\_create\|gmt\_modify,Default gmt\_modify | | `sortType` | string | No | Sort Type,asc\|desc,Default desc | | `userId` | integer | No | Filter UserId, Default All | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/subscription/timeline_list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "count": 0, "page": 0, "sortField": "", "sortType": "", "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/subscription/timeline_list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "count": 0, "page": 0, "sortField": "", "sortType": "", "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ---------------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.subscriptionTimeLines` | array | SubscriptionTimeLines | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Subscription Pending Update List Source: https://docs.unibee.dev/api-reference/subscription-update/get-subscription-pending-update-list get /merchant/subscription/pending_update_list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/subscription/pending_update_list` Get Subscription Pending Update List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ---------------- | ------- | -------- | ------------------------------------------------------- | | `subscriptionId` | string | Yes | SubscriptionId | | `sortField` | string | No | Sort Field,gmt\_create\|gmt\_modify,Default gmt\_modify | | `sortType` | string | No | Sort Type,asc\|desc,Default desc | | `page` | integer | No | Page, Start With 0 | | `count` | integer | No | Count Of Page | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/subscription/pending_update_list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/subscription/pending_update_list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------------------------------- | ------- | ----------------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.subscriptionPendingUpdateDetails` | array | Subscription Pending Update Details | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Subscription Pending Update List Source: https://docs.unibee.dev/api-reference/subscription-update/get-subscription-pending-update-list-1 post /merchant/subscription/pending_update_list ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/subscription/pending_update_list` Get Subscription Pending Update List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------- | ------- | -------- | ------------------------------------------------------- | | `count` | integer | No | Count Of Page | | `page` | integer | No | Page, Start With 0 | | `sortField` | string | No | Sort Field,gmt\_create\|gmt\_modify,Default gmt\_modify | | `sortType` | string | No | Sort Type,asc\|desc,Default desc | | `subscriptionId` | string | Yes | SubscriptionId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/subscription/pending_update_list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "count": 0, "page": 0, "sortField": "", "sortType": "", "subscriptionId": "id_example" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/subscription/pending_update_list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "count": 0, "page": 0, "sortField": "", "sortType": "", "subscriptionId": "id_example" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------------------------------- | ------- | ----------------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.subscriptionPendingUpdateDetails` | array | Subscription Pending Update Details | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Renew Subscription Source: https://docs.unibee.dev/api-reference/subscription-update/renew-subscription post /merchant/subscription/renew Manually renew an existing subscription by generating a new recurring invoice and payment. ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/subscription/renew` Manually renew an existing subscription by generating a new recurring invoice and payment. *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------------------ | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `applyPromoCredit` | boolean | No | Optional. Whether to apply available promo credit to this renewal invoice. | | `applyPromoCreditAmount` | integer | No | Optional. Maximum promo credit amount to apply. If omitted and applyPromoCredit is true, the system auto-computes the usable amount. | | `cancelUrl` | string | No | Optional. URL to redirect the customer to when the renewal payment is cancelled or fails. | | `discount` | string | No | | | `discountCode` | string | No | Optional. Discount or coupon code applied only to this renewal. Overrides the subscription's recurring discount for this invoice. | | `gatewayId` | integer | No | Optional. Payment gateway ID used for the renewal invoice. If omitted, the subscription's original gateway configuration is used. | | `gatewayPaymentType` | string | No | Optional. Payment type for the selected gateway, such as card, wallet, etc. | | `manualPayment` | boolean | No | Optional. If true, do not create an automatic payment for the renewal invoice; the invoice will be created in open status for manual collection. | | `metadata` | object | No | Optional. Custom metadata map that will be stored on the renewal invoice and subscription timeline. | | `paymentUIMode` | string | No | Optional. Checkout UI mode: hosted \| embedded \| custom. Default is hosted. | | `productData` | string | No | | | `productId` | integer | No | Optional. Product ID used together with userId when subscriptionId is not specified, to narrow down which subscription to renew. If 0, the system uses its default product selection rules. | | `returnUrl` | string | No | Optional. URL to redirect the customer to after successful renewal or payment completion. | | `subscriptionId` | string | No | Optional. SubscriptionId to be renewed. Either subscriptionId or userId must be provided. When subscriptionId is omitted, the system first tries to find the latest active or incomplete subscription for the user (and productId if provided), otherwise falls back to the latest subscription. | | `taxPercentage` | integer | No | Optional. External tax percentage override for the renewal invoice, in basis points (e.g. 1000 = 10%%). Overrides the subscription taxPercentage when provided. | | `userId` | integer | No | Optional. UserId associated with the subscription to renew. Either subscriptionId or userId must be provided. Used to locate the target subscription when subscriptionId is not provided. | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/subscription/renew" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "applyPromoCredit": false, "applyPromoCreditAmount": 0, "cancelUrl": "https://example.com", "discount": "", "discountCode": "", "gatewayId": 0, "gatewayPaymentType": "", "manualPayment": false, "metadata": {}, "paymentUIMode": "", "productData": "", "productId": 0, "returnUrl": "https://example.com", "subscriptionId": "id_example", "taxPercentage": 0, "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/subscription/renew" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "applyPromoCredit": false, "applyPromoCreditAmount": 0, "cancelUrl": "https://example.com", "discount": "", "discountCode": "", "gatewayId": 0, "gatewayPaymentType": "", "manualPayment": false, "metadata": {}, "paymentUIMode": "", "productData": "", "productId": 0, "returnUrl": "https://example.com", "subscriptionId": "id_example", "taxPercentage": 0, "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------- | ------- | -------------------------------------------------------------------------------------------------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.action` | object | | | `data.invoiceId` | string | ID of the renewal invoice generated by this request. | | `data.link` | string | Hosted payment or invoice link. When paid=false, redirect the customer to this link to complete the renewal payment. | | `data.paid` | boolean | Whether the renewal invoice has been successfully paid at the time of response. | | `data.paymentId` | string | ID of the payment created for the renewal invoice, if any. | | `data.subscription` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Renew Subscription Preview Source: https://docs.unibee.dev/api-reference/subscription-update/renew-subscription-preview post /merchant/subscription/renew_preview Preview renew invoice of an existing subscription. ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/subscription/renew_preview` Preview renew invoice of an existing subscription. *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------------------ | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `applyPromoCredit` | boolean | No | Optional. Whether to apply available promo credit to this renewal invoice. | | `applyPromoCreditAmount` | integer | No | Optional. Maximum promo credit amount to apply. If omitted and applyPromoCredit is true, the system auto-computes the usable amount. | | `discount` | string | No | | | `discountCode` | string | No | Optional. Discount or coupon code applied only to this renewal. Overrides the subscription's recurring discount for this invoice. | | `gatewayId` | integer | No | Optional. Payment gateway ID used for the renewal invoice. If omitted, the subscription's original gateway configuration is used. | | `gatewayPaymentType` | string | No | Optional. Payment type for the selected gateway, such as card, wallet, etc. | | `metadata` | object | No | Optional. Custom metadata map that will be stored on the renewal invoice and subscription timeline. | | `productData` | string | No | | | `productId` | integer | No | Optional. Product ID used together with userId when subscriptionId is not specified, to narrow down which subscription to renew. If 0, the system uses its default product selection rules. | | `subscriptionId` | string | No | Optional. SubscriptionId to be renewed. Either subscriptionId or userId must be provided. When subscriptionId is omitted, the system first tries to find the latest active or incomplete subscription for the user (and productId if provided), otherwise falls back to the latest subscription. | | `taxPercentage` | integer | No | Optional. External tax percentage override for the renewal invoice, in basis points (e.g. 1000 = 10%%). Overrides the subscription taxPercentage when provided. | | `userId` | integer | No | Optional. UserId associated with the subscription to renew. Either subscriptionId or userId must be provided. Used to locate the target subscription when subscriptionId is not provided. | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/subscription/renew_preview" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "applyPromoCredit": false, "applyPromoCreditAmount": 0, "discount": "", "discountCode": "", "gatewayId": 0, "gatewayPaymentType": "", "metadata": {}, "productData": "", "productId": 0, "subscriptionId": "id_example", "taxPercentage": 0, "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/subscription/renew_preview" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "applyPromoCredit": false, "applyPromoCreditAmount": 0, "discount": "", "discountCode": "", "gatewayId": 0, "gatewayPaymentType": "", "metadata": {}, "productData": "", "productId": 0, "subscriptionId": "id_example", "taxPercentage": 0, "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------------------- | ------- | ---------------------------------------------------------------------------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.applyPromoCredit` | boolean | Whether promo credit is effectively applied in this renew preview. | | `data.currency` | string | Currency used for the renew preview. | | `data.discountAmount` | integer | Total discount amount applied to the renew invoice, including promo credit if applicable. | | `data.invoice` | object | | | `data.originAmount` | integer | Original invoice amount before discounts and promo credits for the renew, in minor units. | | `data.subscription` | object | | | `data.taxAmount` | integer | Total tax amount applied to the renew invoice, in minor units. | | `data.totalAmount` | integer | Final payable amount for the renew invoice, including tax and after discounts, in minor units. | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Subscription Active Temporarily Source: https://docs.unibee.dev/api-reference/subscription-update/subscription-active-temporarily post /merchant/subscription/active_temporarily Subscription active temporarily, status will transmit from pending to incomplete ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/subscription/active_temporarily` Subscription active temporarily, status will transmit from pending to incomplete *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------- | ------- | -------- | ------------------------------------------- | | `expireTime` | integer | Yes | ExpireTime, the expire utc time if not paid | | `subscriptionId` | string | Yes | SubscriptionId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/subscription/active_temporarily" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "expireTime": 0, "subscriptionId": "id_example" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/subscription/active_temporarily" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "expireTime": 0, "subscriptionId": "id_example" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Subscription Pending Update Detail Source: https://docs.unibee.dev/api-reference/subscription-update/subscription-pending-update-detail get /merchant/subscription/pending_update_detail ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/subscription/pending_update_detail` Subscription Pending Update Detail *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ----------------------------- | ------ | -------- | --------------------------- | | `subscriptionPendingUpdateId` | string | Yes | SubscriptionPendingUpdateId | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/subscription/pending_update_detail" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/subscription/pending_update_detail" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.SubscriptionPendingUpdate` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Update Subscription Source: https://docs.unibee.dev/api-reference/subscription-update/update-subscription post /merchant/subscription/update_submit ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/subscription/update_submit` Update Subscription *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------------------ | ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `addonParams` | array | No | Optional. Target addon configuration after the update. | | `applyPromoCredit` | boolean | No | Optional. Whether to apply available promo credit when creating the update invoice. | | `applyPromoCreditAmount` | integer | No | Optional. Maximum promo credit amount to apply. If omitted and applyPromoCredit is true, the system auto-computes the usable amount. | | `cancelUrl` | string | No | Optional. URL to redirect the customer to when the customer cancels or the update payment fails. | | `confirmCurrency` | string | No | Optional. When provided, represents the expected currency code for the update invoice and must match the value returned from update\_preview, otherwise the request is rejected. | | `confirmTotalAmount` | integer | No | Optional. When provided, represents the expected total amount (in minor units) for the update invoice and must match the value returned from update\_preview, otherwise the request is rejected. | | `currency` | string | No | Optional. Target currency for the updated subscription. If not provided, use current subscription currency. Currency change is not allowed when a proration invoice is required. | | `discount` | string | No | | | `discountCode` | string | No | Optional. Discount or coupon code applied to this update. Overrides the subscription's recurring discount for this invoice. | | `effectImmediate` | integer | No | Optional. Override for when to apply the plan change: 1 = immediate (current period, proration will be computed if needed), 2 = at next period (no proration in current period). If 0 or omitted, the system uses default rules (immediate for upgrades, merchant configuration for downgrades, and immediate for non-active subscriptions). | | `gatewayId` | integer | No | Optional. Gateway ID to be used for the invoice generated by this update. If omitted, the subscription's current gateway is used. | | `gatewayPaymentType` | string | No | Optional. Payment type for the selected gateway, such as card, wallet, etc. | | `manualPayment` | boolean | No | Optional. If true, do not create an automatic payment for the update invoice; the invoice will be created in open status for manual collection. | | `metadata` | object | No | Optional. Custom metadata map that will be stored on the update invoice and subscription pending update record. | | `newPlanId` | integer | Yes | Required. Target plan ID to switch the subscription to. | | `paymentUIMode` | string | No | Optional. Checkout UI mode: hosted \| embedded \| custom. Default is hosted. | | `productData` | string | No | | | `prorationDate` | integer | No | Optional. UTC timestamp at which proration should start when effectImmediate = 1. Defaults to current time if not provided. | | `quantity` | integer | Yes | Required. Target quantity for the subscription after update. | | `returnUrl` | string | No | Optional. URL to redirect the customer to after the update is completed or payment succeeds. | | `subscriptionId` | string | No | Optional. SubscriptionId to be upgraded or downgraded. Either subscriptionId or userId must be provided. When userId is used instead of subscriptionId, the only active subscription of that user will be updated. | | `taxPercentage` | integer | No | Optional. External tax percentage override for the update invoice, in basis points (e.g. 1000 = 10%%). Overrides the subscription taxPercentage when provided. | | `userId` | integer | No | Optional. UserId associated with the subscription to update. Either subscriptionId or userId must be provided. When subscriptionId is omitted, the system uses this userId to locate the active subscription. | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/subscription/update_submit" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "addonParams": [], "applyPromoCredit": false, "applyPromoCreditAmount": 0, "cancelUrl": "https://example.com", "confirmCurrency": "", "confirmTotalAmount": 0, "currency": "", "discount": "", "discountCode": "", "effectImmediate": 0, "gatewayId": 0, "gatewayPaymentType": "", "manualPayment": false, "metadata": {}, "newPlanId": 0, "paymentUIMode": "", "productData": "", "prorationDate": 0, "quantity": 0, "returnUrl": "https://example.com", "subscriptionId": "id_example", "taxPercentage": 0, "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/subscription/update_submit" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "addonParams": [], "applyPromoCredit": false, "applyPromoCreditAmount": 0, "cancelUrl": "https://example.com", "confirmCurrency": "", "confirmTotalAmount": 0, "currency": "", "discount": "", "discountCode": "", "effectImmediate": 0, "gatewayId": 0, "gatewayPaymentType": "", "manualPayment": false, "metadata": {}, "newPlanId": 0, "paymentUIMode": "", "productData": "", "prorationDate": 0, "quantity": 0, "returnUrl": "https://example.com", "subscriptionId": "id_example", "taxPercentage": 0, "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------ | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.action` | object | | | `data.invoiceId` | string | ID of the invoice generated by this update (proration or next-period invoice, depending on effectImmediate). | | `data.link` | string | Hosted payment or invoice link. When paid=false and an invoice exists, redirect the customer to this link to complete payment. | | `data.note` | string | Additional message describing the update result, used for internal or merchant-facing explanations. | | `data.paid` | boolean | Whether the update invoice has been successfully paid at the time of response. | | `data.paymentId` | string | ID of the payment created for the update invoice, if any. | | `data.subscriptionPendingUpdate` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Update Subscription Metadata Source: https://docs.unibee.dev/api-reference/subscription-update/update-subscription-metadata post /merchant/subscription/metadata_update ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/subscription/metadata_update` Update Subscription Metadata *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------- | ------ | -------- | -------------- | | `metadata` | object | No | Metadata,Map | | `subscriptionId` | string | No | SubscriptionId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/subscription/metadata_update" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "metadata": {}, "subscriptionId": "id_example" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/subscription/metadata_update" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "metadata": {}, "subscriptionId": "id_example" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Update Subscription Preview Source: https://docs.unibee.dev/api-reference/subscription-update/update-subscription-preview post /merchant/subscription/update_preview ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/subscription/update_preview` Update Subscription Preview *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------------------ | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `addonParams` | array | No | Optional. Target addon configuration after the update. | | `applyPromoCredit` | boolean | No | Optional. Whether to apply available promo credit to the update preview. | | `applyPromoCreditAmount` | integer | No | Optional. Maximum promo credit amount to apply in preview. If omitted and applyPromoCredit is true, the system auto-computes the usable amount. | | `currency` | string | No | Optional. Target currency for the updated subscription. If not provided, use current subscription currency. Currency change may be restricted when proration is required. | | `discountCode` | string | No | Optional. Discount code applied to the update preview. | | `effectImmediate` | integer | No | Optional. When to apply the plan change: 1 = immediate (current period, proration will be computed), 2 = at next period (no proration in current period). | | `gatewayId` | integer | No | Optional. Gateway ID for previewing payment routing. If not provided, the subscription's current gateway is used for preview. | | `newPlanId` | integer | Yes | Required. Target plan ID to switch the subscription to. | | `prorationDate` | integer | No | Optional. UTC timestamp at which proration should start when effectImmediate = 1. Defaults to current time if not provided. | | `quantity` | integer | No | Optional. Target quantity for the subscription. If \<= 0, it defaults to 1. | | `subscriptionId` | string | Yes | Required. SubscriptionId to be upgraded or downgraded. | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/subscription/update_preview" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "addonParams": [], "applyPromoCredit": false, "applyPromoCreditAmount": 0, "currency": "", "discountCode": "", "effectImmediate": 0, "gatewayId": 0, "newPlanId": 0, "prorationDate": 0, "quantity": 0, "subscriptionId": "id_example" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/subscription/update_preview" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "addonParams": [], "applyPromoCredit": false, "applyPromoCreditAmount": 0, "currency": "", "discountCode": "", "effectImmediate": 0, "gatewayId": 0, "newPlanId": 0, "prorationDate": 0, "quantity": 0, "subscriptionId": "id_example" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------------ | ------- | ----------------------------------------------------------------------------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.applyPromoCredit` | boolean | Whether promo credit is effectively applied in this update preview. | | `data.currency` | string | Currency used for the update preview. | | `data.discount` | object | | | `data.discountAmount` | integer | Total discount amount applied to the update invoice, including promo credit if applicable. | | `data.discountMessage` | string | Human-readable message describing discount application result for the update. | | `data.invoice` | object | | | `data.nextPeriodInvoice` | object | | | `data.originAmount` | integer | Original invoice amount before discounts and promo credit for the update, in minor units. | | `data.prorationDate` | integer | Effective proration start time used in this preview, as UTC timestamp (seconds). | | `data.totalAmount` | integer | Final payable amount for the update invoice, including tax and after discounts, in minor units. | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Append Subscription TrialEnd Source: https://docs.unibee.dev/api-reference/subscription/append-subscription-trialend post /merchant/subscription/add_new_trial_start ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/subscription/add_new_trial_start` Append Subscription TrialEnd *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | -------------------- | ------- | -------- | ------------------------------- | | `appendTrialEndHour` | integer | Yes | add appendTrialEndHour For Free | | `subscriptionId` | string | Yes | SubscriptionId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/subscription/add_new_trial_start" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "appendTrialEndHour": 0, "subscriptionId": "id_example" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/subscription/add_new_trial_start" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "appendTrialEndHour": 0, "subscriptionId": "id_example" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Apply Discount Or Premo Credit To Next Invoice Source: https://docs.unibee.dev/api-reference/subscription/apply-discount-or-premo-credit-to-next-invoice post /merchant/subscription/apply_subscription_next_invoice ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/subscription/apply_subscription_next_invoice` Apply Discount Or Premo Credit To Next Invoice *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------------------ | ------- | -------- | ----------------------------------------------------------------------------------------------------- | | `applyPromoCreditAmount` | integer | No | apply promo credit amount | | `discountCode` | string | No | DiscountCode | | `externalUserId` | string | No | ExternalUserId, unique, either ExternalUserId\&Email or UserId needed if subscriptionId not specified | | `productId` | integer | No | default product will use if productId not specified and subscriptionId is blank | | `subscriptionId` | string | No | SubscriptionId | | `userId` | integer | No | UserId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/subscription/apply_subscription_next_invoice" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "applyPromoCreditAmount": 0, "discountCode": "", "externalUserId": "id_example", "productId": 0, "subscriptionId": "id_example", "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/subscription/apply_subscription_next_invoice" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "applyPromoCreditAmount": 0, "discountCode": "", "externalUserId": "id_example", "productId": 0, "subscriptionId": "id_example", "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.invoice` | object | | | `data.subscription` | object | | | `data.subscriptionPendingUpdate` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Cancel Last Cancel Subscription At Period End Source: https://docs.unibee.dev/api-reference/subscription/cancel-last-cancel-subscription-at-period-end post /merchant/subscription/cancel_last_cancel_at_period_end This action should be request before subscription's period end, If subscription's flag 'cancelAtPeriodEnd' is enabled, this action will resume it to disable, and subscription will continue cycle recurring seems no cancelAtPeriod action be setting ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/subscription/cancel_last_cancel_at_period_end` This action should be request before subscription's period end, If subscription's flag 'cancelAtPeriodEnd' is enabled, this action will resume it to disable, and subscription will continue cycle recurring seems no cancelAtPeriod action be setting *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------- | | `productId` | integer | No | default product will use if productId not specified and subscriptionId is blank | | `subscriptionId` | string | No | SubscriptionId, id of subscription, either SubscriptionId or UserId needed, The only one active subscription of userId will effect | | `userId` | integer | No | UserId, either SubscriptionId or UserId needed, The only one active subscription will effect if userId provide instead of subscriptionId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/subscription/cancel_last_cancel_at_period_end" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "productId": 0, "subscriptionId": "id_example", "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/subscription/cancel_last_cancel_at_period_end" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "productId": 0, "subscriptionId": "id_example", "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Cancel Subscription At Period End Source: https://docs.unibee.dev/api-reference/subscription/cancel-subscription-at-period-end post /merchant/subscription/cancel_at_period_end Cancel subscription at period end, the subscription will not turn to 'cancelled' at once but will cancelled at period end time, no invoice will generate, the flag 'cancelAtPeriodEnd' of subscription will be enabled ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/subscription/cancel_at_period_end` Cancel subscription at period end, the subscription will not turn to 'cancelled' at once but will cancelled at period end time, no invoice will generate, the flag 'cancelAtPeriodEnd' of subscription will be enabled *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------- | | `productId` | integer | No | default product will use if productId not specified and subscriptionId is blank | | `subscriptionId` | string | No | SubscriptionId, id of subscription, either SubscriptionId or UserId needed, The only one active subscription of userId will effect | | `userId` | integer | No | UserId, either SubscriptionId or UserId needed, The only one active subscription will effect if userId provide instead of subscriptionId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/subscription/cancel_at_period_end" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "productId": 0, "subscriptionId": "id_example", "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/subscription/cancel_at_period_end" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "productId": 0, "subscriptionId": "id_example", "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Cancel Subscription Immediately Source: https://docs.unibee.dev/api-reference/subscription/cancel-subscription-immediately post /merchant/subscription/cancel Cancel subscription immediately, no proration invoice will generate ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/subscription/cancel` Cancel subscription immediately, no proration invoice will generate *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------- | | `invoiceNow` | boolean | No | Default false | | `productId` | integer | No | default product will use if productId not specified and subscriptionId is blank | | `prorate` | boolean | No | Prorate Generate Invoice,Default false | | `reason` | string | No | Reason | | `subscriptionId` | string | No | SubscriptionId, id of subscription, either SubscriptionId or UserId needed, The only one active subscription of userId will effect | | `userId` | integer | No | UserId, either SubscriptionId or UserId needed, The only one active subscription will effect if userId provide instead of subscriptionId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/subscription/cancel" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceNow": false, "productId": 0, "prorate": false, "reason": "", "subscriptionId": "id_example", "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/subscription/cancel" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceNow": false, "productId": 0, "prorate": false, "reason": "", "subscriptionId": "id_example", "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Change Subscription Currency Source: https://docs.unibee.dev/api-reference/subscription/change-subscription-currency post /merchant/subscription/change_currency Change subscription currency, only available for merchants with multi-currency enabled ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/subscription/change_currency` Change subscription currency, only available for merchants with multi-currency enabled *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------- | ------ | -------- | --------------------- | | `currency` | string | Yes | The new currency code | | `subscriptionId` | string | Yes | SubscriptionId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/subscription/change_currency" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "currency": "", "subscriptionId": "id_example" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/subscription/change_currency" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "currency": "", "subscriptionId": "id_example" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Change Subscription Due Day Source: https://docs.unibee.dev/api-reference/subscription/change-subscription-due-day post /merchant/subscription/change_due_day Change subscription due day ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/subscription/change_due_day` Change subscription due day *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------- | ------- | -------- | ------------------------------ | | `dueDay` | integer | Yes | DueDay, UTC timestamp, seconds | | `subscriptionId` | string | Yes | SubscriptionId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/subscription/change_due_day" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "dueDay": 0, "subscriptionId": "id_example" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/subscription/change_due_day" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "dueDay": 0, "subscriptionId": "id_example" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Change Subscription Gateway Source: https://docs.unibee.dev/api-reference/subscription/change-subscription-gateway post /merchant/subscription/change_gateway ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/subscription/change_gateway` Change Subscription Gateway *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------------- | ------- | -------- | --------------- | | `gatewayId` | integer | Yes | GatewayId | | `paymentMethodId` | string | No | PaymentMethodId | | `subscriptionId` | string | Yes | SubscriptionId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/subscription/change_gateway" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "gatewayId": 0, "paymentMethodId": "id_example", "subscriptionId": "id_example" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/subscription/change_gateway" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "gatewayId": 0, "paymentMethodId": "id_example", "subscriptionId": "id_example" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Create Subscription Source: https://docs.unibee.dev/api-reference/subscription/create-subscription post /merchant/subscription/create_submit ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/subscription/create_submit` Create Subscription *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------------------ | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `addonParams` | array | No | Optional. List of addon plan parameters to be attached to this subscription. | | `applyPromoCredit` | boolean | No | Optional. Whether to apply available promo credit when creating the first invoice. | | `applyPromoCreditAmount` | integer | No | Optional. Maximum promo credit amount to apply. If omitted and applyPromoCredit is true, the system auto-computes the usable amount. | | `cancelUrl` | string | No | Optional. URL to redirect the user to when the user cancels or the payment fails. | | `confirmCurrency` | string | No | Optional. When provided, represents the expected currency code for the first invoice and must match the value returned from preview, otherwise the request is rejected. | | `confirmTotalAmount` | integer | No | Optional. When provided, represents the expected total amount (in minor units) for the first invoice and must match the value returned from preview, otherwise the request is rejected. | | `currency` | string | No | Optional. Currency code for charging (e.g. USD, EUR). If empty, plan default currency is used. | | `discount` | string | No | | | `discountCode` | string | No | Optional. Discount or coupon code to be applied to this subscription creation. | | `email` | string | No | Optional. End-user email. One of (ExternalUserId & Email), UserId or User object must be provided to identify the user. | | `externalUserId` | string | No | Optional. Merchant-side unique user identifier. Used together with email when UserId is not provided. | | `freeInInitialPeriod` | boolean | No | Optional. If true, the first billing period is treated as free or trial. This has higher priority than trialEnd. | | `freeTimeEnd` | integer | No | Optional. Custom free period end time when freeInInitialPeriod is true, as UTC timestamp (seconds). Has higher priority than trialEnd and can shorten or extend the default first-period-free behavior. | | `gatewayId` | integer | No | Optional. Payment gateway ID used to charge the first invoice of this subscription. | | `gatewayPaymentType` | string | No | Optional. Payment type for the selected gateway, such as card, wallet, etc. | | `metadata` | object | No | Optional. Custom metadata map that will be stored on the created invoice and subscription. | | `paymentMethodId` | string | No | Optional. Existing payment method ID to be used for charging the first invoice. | | `paymentUIMode` | string | No | Optional. Checkout UI mode: hosted \| embedded \| custom. Default is hosted. | | `planId` | integer | Yes | Required. ID of the subscription plan to be created. | | `productData` | string | No | | | `quantity` | integer | No | Optional. Number of units for the plan. Defaults to 1 if not specified. | | `returnUrl` | string | No | Optional. URL to redirect the user to after successful subscription creation or payment completion. | | `splitPayment` | boolean | No | Optional. If true, always use split payment mode: create a hosted invoice link without attempting automatic payment. If false, the system will try automatic payment first and may still switch to split payment based on gateway response and risk control. | | `startIncomplete` | boolean | No | Optional. If true, the subscription starts in incomplete status (now pay later): invoice is created and the subscription becomes active temporarily until paid or expired. | | `taxPercentage` | integer | No | Optional. External tax percentage override, in basis points (e.g. 1000 = 10%%). Overrides subscription-level taxPercentage when provided. | | `trialEnd` | integer | No | Optional. Custom trial end time as UTC timestamp (seconds). If greater than now, it overrides the plan default trial configuration. | | `user` | string | No | | | `userId` | integer | No | Optional. Internal UniBee user ID. If provided, it must be consistent with email/user when they are also provided. | | `vatCountryCode` | string | No | Optional. ISO country code for VAT calculation. If provided together with vatNumber, they must be consistent. | | `vatNumber` | string | No | Optional. Customer VAT number used for VAT validation and tax calculation. | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/subscription/create_submit" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "addonParams": [], "applyPromoCredit": false, "applyPromoCreditAmount": 0, "cancelUrl": "https://example.com", "confirmCurrency": "", "confirmTotalAmount": 0, "currency": "", "discount": "", "discountCode": "", "email": "user@example.com", "externalUserId": "id_example", "freeInInitialPeriod": false, "freeTimeEnd": 0, "gatewayId": 0, "gatewayPaymentType": "", "metadata": {}, "paymentMethodId": "id_example", "paymentUIMode": "", "planId": 0, "productData": "", "quantity": 0, "returnUrl": "https://example.com", "splitPayment": false, "startIncomplete": false, "taxPercentage": 0, "trialEnd": 0, "user": "", "userId": 0, "vatCountryCode": "", "vatNumber": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/subscription/create_submit" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "addonParams": [], "applyPromoCredit": false, "applyPromoCreditAmount": 0, "cancelUrl": "https://example.com", "confirmCurrency": "", "confirmTotalAmount": 0, "currency": "", "discount": "", "discountCode": "", "email": "user@example.com", "externalUserId": "id_example", "freeInInitialPeriod": false, "freeTimeEnd": 0, "gatewayId": 0, "gatewayPaymentType": "", "metadata": {}, "paymentMethodId": "id_example", "paymentUIMode": "", "planId": 0, "productData": "", "quantity": 0, "returnUrl": "https://example.com", "splitPayment": false, "startIncomplete": false, "taxPercentage": 0, "trialEnd": 0, "user": "", "userId": 0, "vatCountryCode": "", "vatNumber": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------------------------- | ------- | -------------------------------------------------------------------------------------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.action` | object | | | `data.invoiceId` | string | ID of the first invoice generated for this subscription. | | `data.link` | string | Hosted payment or invoice link. When paid=false, redirect the customer to this link to complete payment. | | `data.otherPendingCryptoSubscription` | object | | | `data.paid` | boolean | Whether the first invoice has been successfully paid at the time of response. | | `data.paymentId` | string | ID of the payment created for the first invoice, if any. | | `data.subscription` | object | | | `data.token` | string | Portal authentication token for the user, used by admin portal flows. | | `data.user` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Create Subscription Preview Source: https://docs.unibee.dev/api-reference/subscription/create-subscription-preview post /merchant/subscription/create_preview ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/subscription/create_preview` Create Subscription Preview *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------------------ | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `addonParams` | array | No | Optional. List of addon plan parameters to be attached to this subscription. | | `applyPromoCredit` | boolean | No | Optional. Whether to apply available promo credit to this preview calculation. | | `applyPromoCreditAmount` | integer | No | Optional. Maximum promo credit amount to apply. If omitted and applyPromoCredit is true, the system auto-computes the usable amount. | | `currency` | string | No | Optional. Currency code for pricing (e.g. USD, EUR). If empty, plan default currency is used. | | `discountCode` | string | No | Optional. Discount or coupon code applied to this preview. | | `email` | string | No | Optional. End-user email. Required when creating a new user via ExternalUserId\&Email if userId is not provided. | | `externalUserId` | string | No | Optional. Merchant-side unique user identifier. Use together with email when userId is not provided. | | `freeInInitialPeriod` | boolean | No | Optional. If true, the first billing period is treated as free or trial, taking precedence over trialEnd. | | `freeTimeEnd` | integer | No | Optional. Custom free period end time when freeInInitialPeriod is true, as UTC timestamp (seconds). Can shorten or extend the default first-period-free behavior. | | `gatewayId` | integer | No | Optional. Payment gateway ID to be used for this subscription preview. If omitted, default gateway selection rules apply. | | `gatewayPaymentType` | string | No | Optional. Payment type for the selected gateway, such as card, wallet, etc. | | `planId` | integer | Yes | Required. ID of the subscription plan to be purchased. | | `quantity` | integer | No | Optional. Number of units for the plan. Defaults to 1 if not specified. | | `taxPercentage` | integer | No | Optional. External tax percentage override, in basis points (e.g. 1000 = 10%%). Only available for OpenAPI calls. | | `trialEnd` | integer | No | Optional. Custom trial end time as UTC timestamp (seconds). Overrides plan default trial configuration when greater than now. | | `user` | string | No | | | `userId` | integer | No | Optional. Internal user ID in UniBee. If provided, it must match the email/user object when they are also provided. | | `vatCountryCode` | string | No | Optional. ISO country code for VAT calculation. If provided together with vatNumber, they must be consistent. | | `vatNumber` | string | No | Optional. Customer VAT number used for VAT validation and tax calculation. | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/subscription/create_preview" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "addonParams": [], "applyPromoCredit": false, "applyPromoCreditAmount": 0, "currency": "", "discountCode": "", "email": "user@example.com", "externalUserId": "id_example", "freeInInitialPeriod": false, "freeTimeEnd": 0, "gatewayId": 0, "gatewayPaymentType": "", "planId": 0, "quantity": 0, "taxPercentage": 0, "trialEnd": 0, "user": "", "userId": 0, "vatCountryCode": "", "vatNumber": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/subscription/create_preview" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "addonParams": [], "applyPromoCredit": false, "applyPromoCreditAmount": 0, "currency": "", "discountCode": "", "email": "user@example.com", "externalUserId": "id_example", "freeInInitialPeriod": false, "freeTimeEnd": 0, "gatewayId": 0, "gatewayPaymentType": "", "planId": 0, "quantity": 0, "taxPercentage": 0, "trialEnd": 0, "user": "", "userId": 0, "vatCountryCode": "", "vatNumber": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------------------------- | ------- | -------------------------------------------------------------------------------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.addonParams` | array | Addon parameters used to compute the preview. | | `data.addons` | array | Resolved addon plan details included in this preview. | | `data.applyPromoCredit` | boolean | Whether promo credit is effectively applied in this preview. | | `data.currency` | string | Currency used for this preview. | | `data.discount` | object | | | `data.discountAmount` | integer | Total discount amount applied in this preview, including promo credit if applicable. | | `data.discountMessage` | string | Human-readable message describing discount application result. | | `data.email` | string | Resolved user email used in this preview. | | `data.gateway` | object | | | `data.invoice` | object | | | `data.originAmount` | integer | Original invoice amount before discounts and promo credit, in minor units. | | `data.otherActiveSubscriptionId` | string | other active or incomplete subscription id | | `data.otherPendingCryptoSubscription` | object | | | `data.plan` | object | | | `data.quantity` | integer | Quantity of the plan used in preview. | | `data.subscriptionAmountExcludingTax` | integer | Total subscription amount excluding tax for the previewed invoice, in minor units. | | `data.taxAmount` | integer | Total tax amount for the previewed invoice, in minor units. | | `data.taxPercentage` | integer | Effective tax percentage applied in this preview, in basis points (e.g. 1000 = 10%%). | | `data.totalAmount` | integer | Final payable amount for the previewed invoice, including tax and after discounts, in minor units. | | `data.trialEnd` | integer | trial\_end, utc time | | `data.userId` | integer | Resolved user ID used in this preview. | | `data.vatCountryCode` | string | Country code used for VAT calculation. | | `data.vatCountryName` | string | Country name used for VAT calculation, when available. | | `data.vatNumber` | string | VAT number used in this preview, if any. | | `data.vatNumberValidate` | object | | | `data.vatNumberValidateMessage` | string | Human-readable message for VAT number validation result. | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Subscription List Source: https://docs.unibee.dev/api-reference/subscription/get-subscription-list get /merchant/subscription/list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/subscription/list` Get Subscription List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ----------------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------- | | `userId` | integer | No | UserId | | `externalUserId` | string | No | ExternalUserId | | `searchKey` | string | No | Search SubscriptionId\|Email | | `Email` | string | No | The filter email of subscription user | | `status` | array | No | Filter, Default All,Status,1-Pending|2-Active|3-Suspend \| 4-Cancel \| 5-Expire \| 6- Suspend\| 7-Incomplete \| 8-Processing \| 9-Failed | | `currency` | string | No | The currency of subscription | | `planIds` | array | No | The filter ids of plan | | `productIds` | array | No | The filter ids of product, invalid if planIds is provided | | `amountStart` | integer | No | The filter start amount of subscription | | `amountEnd` | integer | No | The filter end amount of subscription | | `sortField` | string | No | Sort Field,gmt\_create\|gmt\_modify,Default gmt\_modify | | `sortType` | string | No | Sort Type,asc\|desc,Default desc | | `page` | integer | No | Page, Start With 0 | | `count` | integer | No | Count Of Page | | `createTimeStart` | integer | No | CreateTimeStart,UTC timestamp,seconds | | `createTimeEnd` | integer | No | CreateTimeEnd,UTC timestamp,seconds | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/subscription/list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/subscription/list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.subscriptions` | array | Subscriptions | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Subscription List Source: https://docs.unibee.dev/api-reference/subscription/get-subscription-list-1 post /merchant/subscription/list ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/subscription/list` Get Subscription List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------- | | `Email` | string | No | The filter email of subscription user | | `amountEnd` | integer | No | The filter end amount of subscription | | `amountStart` | integer | No | The filter start amount of subscription | | `count` | integer | No | Count Of Page | | `createTimeEnd` | integer | No | CreateTimeEnd,UTC timestamp,seconds | | `createTimeStart` | integer | No | CreateTimeStart,UTC timestamp,seconds | | `currency` | string | No | The currency of subscription | | `externalUserId` | string | No | ExternalUserId | | `page` | integer | No | Page, Start With 0 | | `planIds` | array | No | The filter ids of plan | | `productIds` | array | No | The filter ids of product, invalid if planIds is provided | | `searchKey` | string | No | Search SubscriptionId\|Email | | `sortField` | string | No | Sort Field,gmt\_create\|gmt\_modify,Default gmt\_modify | | `sortType` | string | No | Sort Type,asc\|desc,Default desc | | `status` | array | No | Filter, Default All,Status,1-Pending|2-Active|3-Suspend \| 4-Cancel \| 5-Expire \| 6- Suspend\| 7-Incomplete \| 8-Processing \| 9-Failed | | `userId` | integer | No | UserId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/subscription/list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "Email": "user@example.com", "amountEnd": 0, "amountStart": 0, "count": 0, "createTimeEnd": 0, "createTimeStart": 0, "currency": "", "externalUserId": "id_example", "page": 0, "planIds": [], "productIds": [], "searchKey": "", "sortField": "", "sortType": "", "status": [], "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/subscription/list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "Email": "user@example.com", "amountEnd": 0, "amountStart": 0, "count": 0, "createTimeEnd": 0, "createTimeStart": 0, "currency": "", "externalUserId": "id_example", "page": 0, "planIds": [], "productIds": [], "searchKey": "", "sortField": "", "sortType": "", "status": [], "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.subscriptions` | array | Subscriptions | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Subscription Detail Source: https://docs.unibee.dev/api-reference/subscription/subscription-detail get /merchant/subscription/detail ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/subscription/detail` Subscription Detail *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ---------------- | ------ | -------- | -------------- | | `subscriptionId` | string | Yes | SubscriptionId | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/subscription/detail" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/subscription/detail" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------------------------------ | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.addonParams` | array | AddonParams | | `data.addons` | array | Plan Addon | | `data.gateway` | object | | | `data.latestInvoice` | object | | | `data.plan` | object | | | `data.subscription` | object | | | `data.unfinishedSubscriptionPendingUpdate` | object | | | `data.user` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Subscription Detail Source: https://docs.unibee.dev/api-reference/subscription/subscription-detail-1 post /merchant/subscription/detail ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/subscription/detail` Subscription Detail *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------- | ------ | -------- | -------------- | | `subscriptionId` | string | Yes | SubscriptionId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/subscription/detail" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "subscriptionId": "id_example" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/subscription/detail" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "subscriptionId": "id_example" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------------------------------ | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.addonParams` | array | AddonParams | | `data.addons` | array | Plan Addon | | `data.gateway` | object | | | `data.latestInvoice` | object | | | `data.plan` | object | | | `data.subscription` | object | | | `data.unfinishedSubscriptionPendingUpdate` | object | | | `data.user` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Subscription Next Invoice Preview Source: https://docs.unibee.dev/api-reference/subscription/subscription-next-invoice-preview get /merchant/subscription/preview_subscription_next_invoice ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/subscription/preview_subscription_next_invoice` Subscription Next Invoice Preview *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ---------------- | ------- | -------- | ----------------------------------------------------------------------------------------------------- | | `userId` | integer | No | UserId | | `externalUserId` | string | No | ExternalUserId, unique, either ExternalUserId\&Email or UserId needed if subscriptionId not specified | | `productId` | integer | No | default product will use if productId not specified and subscriptionId is blank | | `subscriptionId` | string | No | SubscriptionId | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/subscription/preview_subscription_next_invoice" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/subscription/preview_subscription_next_invoice" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.invoice` | object | | | `data.subscription` | object | | | `data.subscriptionPendingUpdate` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # User Pending Crypto Subscription Detail Source: https://docs.unibee.dev/api-reference/subscription/user-pending-crypto-subscription-detail get /merchant/subscription/user_pending_crypto_subscription_detail ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/subscription/user_pending_crypto_subscription_detail` User Pending Crypto Subscription Detail *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ---------------- | ------- | -------- | ------------------------------------------------------------------------------- | | `userId` | integer | No | UserId | | `externalUserId` | string | No | ExternalUserId, unique, either ExternalUserId\&Email or UserId needed | | `productId` | integer | No | default product will use if productId not specified and subscriptionId is blank | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/subscription/user_pending_crypto_subscription_detail" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/subscription/user_pending_crypto_subscription_detail" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.subscription` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # User Pending Crypto Subscription Detail Source: https://docs.unibee.dev/api-reference/subscription/user-pending-crypto-subscription-detail-1 post /merchant/subscription/user_pending_crypto_subscription_detail ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/subscription/user_pending_crypto_subscription_detail` User Pending Crypto Subscription Detail *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------- | ------- | -------- | ------------------------------------------------------------------------------- | | `externalUserId` | string | No | ExternalUserId, unique, either ExternalUserId\&Email or UserId needed | | `productId` | integer | No | default product will use if productId not specified and subscriptionId is blank | | `userId` | integer | No | UserId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/subscription/user_pending_crypto_subscription_detail" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalUserId": "id_example", "productId": 0, "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/subscription/user_pending_crypto_subscription_detail" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalUserId": "id_example", "productId": 0, "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.subscription` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # User Subscription Detail Source: https://docs.unibee.dev/api-reference/subscription/user-subscription-detail get /merchant/subscription/user_subscription_detail ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/subscription/user_subscription_detail` User Subscription Detail *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ---------------- | ------- | -------- | ------------------------------------------------------------------------------- | | `userId` | integer | No | UserId | | `externalUserId` | string | No | ExternalUserId, unique, either ExternalUserId\&Email or UserId needed | | `productId` | integer | No | default product will use if productId not specified and subscriptionId is blank | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/subscription/user_subscription_detail" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/subscription/user_subscription_detail" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------------------------------ | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.addons` | array | Plan Addon | | `data.gateway` | object | | | `data.latestInvoice` | object | | | `data.plan` | object | | | `data.subscription` | object | | | `data.unfinishedSubscriptionPendingUpdate` | object | | | `data.user` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # User Subscription Detail Source: https://docs.unibee.dev/api-reference/subscription/user-subscription-detail-1 post /merchant/subscription/user_subscription_detail ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/subscription/user_subscription_detail` User Subscription Detail *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------- | ------- | -------- | ------------------------------------------------------------------------------- | | `externalUserId` | string | No | ExternalUserId, unique, either ExternalUserId\&Email or UserId needed | | `productId` | integer | No | default product will use if productId not specified and subscriptionId is blank | | `userId` | integer | No | UserId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/subscription/user_subscription_detail" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalUserId": "id_example", "productId": 0, "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/subscription/user_subscription_detail" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalUserId": "id_example", "productId": 0, "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------------------------------ | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.addons` | array | Plan Addon | | `data.gateway` | object | | | `data.latestInvoice` | object | | | `data.plan` | object | | | `data.subscription` | object | | | `data.unfinishedSubscriptionPendingUpdate` | object | | | `data.user` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get User Discount Code List Source: https://docs.unibee.dev/api-reference/user-discount/get-user-discount-code-list get /merchant/discount/user_discount_list Get user discountCode list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/discount/user_discount_list` Get user discountCode list *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ----------------- | ------- | -------- | ----------------------------------------------------------------------------- | | `id` | integer | Yes | The discount's Id | | `userIds` | array | No | Filter UserIds Default All | | `email` | string | No | Filter Email Default All | | `planIds` | array | No | Filter PlanIds Default All | | `subscriptionIds` | array | No | Filter SubscriptionIds Default All | | `status` | array | No | Filter Status Default All, 1-normal, 2-rollback | | `childCode` | string | No | Filter Child Code (fuzzy search), only available when Id is batch template ID | | `sortField` | string | No | Sort Field,gmt\_create\|gmt\_modify,Default gmt\_modify | | `sortType` | string | No | Sort Type,asc\|desc,Default desc | | `page` | integer | No | Page, Start 0 | | `count` | integer | No | Count Of Per Page | | `createTimeStart` | integer | No | CreateTimeStart,UTC timestamp,seconds | | `createTimeEnd` | integer | No | CreateTimeEnd,UTC timestamp,seconds | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/discount/user_discount_list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/discount/user_discount_list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.total` | integer | Total | | `data.userDiscounts` | array | User Discount Object List | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Plan Apply Preview Source: https://docs.unibee.dev/api-reference/user-discount/plan-apply-preview post /merchant/discount/plan_apply_preview Check discount can apply to plan, Only check rules about plan,the actual usage is subject to the subscription interface ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/discount/plan_apply_preview` Check discount can apply to plan, Only check rules about plan,the actual usage is subject to the subscription interface *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------------------- | ------- | -------- | ------------------------------------------------------------------------------------- | | `addonParams` | array | No | Addon list with quantity, align with subscription create preview | | `code` | string | Yes | The discount's unique code, customize by merchant | | `currency` | string | No | The currency of plan which code to apply | | `email` | string | No | Email | | `externalPlanId` | string | No | The externalId of plan which code to apply, either planId or externalPlanId is needed | | `isChangeToLongPlan` | boolean | No | IsChangeToLongPlan | | `isChangeToSameIntervalPlan` | boolean | No | IsChangeToSameIntervalPlan | | `isUpgrade` | boolean | No | IsUpgrade | | `planId` | integer | No | The id of plan which code to apply, either planId or externalPlanId is needed | | `quantity` | integer | No | Main plan quantity, default 1; align with subscription create preview | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/discount/plan_apply_preview" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "addonParams": [], "code": "", "currency": "", "email": "user@example.com", "externalPlanId": "id_example", "isChangeToLongPlan": false, "isChangeToSameIntervalPlan": false, "isUpgrade": false, "planId": 0, "quantity": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/discount/plan_apply_preview" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "addonParams": [], "code": "", "currency": "", "email": "user@example.com", "externalPlanId": "id_example", "isChangeToLongPlan": false, "isChangeToSameIntervalPlan": false, "isUpgrade": false, "planId": 0, "quantity": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ---------------------- | ------- | --------------------------------------------------------------------------------------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.allPlansAllowed` | boolean | True = discount applies to all plans in cart; false = only to allowedPlanIds | | `data.allowedPlanIds` | array | Plan ids that get this discount (when partial apply); empty or same as main+addons when all plans allowed | | `data.discountAmount` | integer | The discount amount can apply to plan | | `data.discountCode` | object | | | `data.failureReason` | string | The apply preview failure reason | | `data.valid` | boolean | The apply preview result, true or false | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # List invoices that can be used for metric_by_invoice (paid, subscription cycle only) Source: https://docs.unibee.dev/api-reference/user-metric/list-invoices-that-can-be-used-for-metric_by_invoice-paid-subscription-cycle-only get /merchant/metric/user/history/invoices_metric_queryable ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/metric/user/history/invoices_metric_queryable` List invoices that can be used for metric\_by\_invoice (paid, subscription cycle only) *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ---------------- | ------- | -------- | -------------------------------------------------- | | `userId` | integer | Yes | UserId | | `subscriptionId` | string | No | Optional subscription id to filter by subscription | | `page` | integer | No | Page, start 0 | | `count` | integer | No | Count per page | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/metric/user/history/invoices_metric_queryable" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/metric/user/history/invoices_metric_queryable" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.invoices` | array | Invoice Detail Object List | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Query User History Limit Metric By Invoice (History Query Mode, limit_metered and limit_recurring only) Source: https://docs.unibee.dev/api-reference/user-metric/query-user-history-limit-metric-by-invoice-history-query-mode-limit_metered-and-limit_recurring-only get /merchant/metric/user/history/metric_by_invoice ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/metric/user/history/metric_by_invoice` Query User History Limit Metric By Invoice (History Query Mode, limit\_metered and limit\_recurring only) *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ----------- | ------ | -------- | ------------------------ | | `invoiceId` | string | Yes | The unique id of invoice | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/metric/user/history/metric_by_invoice" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/metric/user/history/metric_by_invoice" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.isLatestPaidInvoice` | boolean | True when current-metric path was used (queried invoice is the subscription's latest paid invoice), false when snapshot or history path was used | | `data.userHistoryMetric` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Query User History Limit Metric By Subscription (History Query Mode, limit_metered and limit_recurring only, non-active subscription only) Source: https://docs.unibee.dev/api-reference/user-metric/query-user-history-limit-metric-by-subscription-history-query-mode-limit_metered-and-limit_recurring-only-non-active-subscription-only get /merchant/metric/user/history/metric_by_subscription ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/metric/user/history/metric_by_subscription` Query User History Limit Metric By Subscription (History Query Mode, limit\_metered and limit\_recurring only, non-active subscription only) *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ---------------- | ------ | -------- | ---------------------------------------------------------------------------------------------- | | `subscriptionId` | string | Yes | The unique id of subscription (must be non-active subscription or non-incomplete subscription) | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/metric/user/history/metric_by_subscription" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/metric/user/history/metric_by_subscription" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------------ | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.userHistoryMetric` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Query User Metric Source: https://docs.unibee.dev/api-reference/user-metric/query-user-metric get /merchant/metric/user/metric ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/metric/user/metric` Query User Metric *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ---------------- | ------- | -------- | ---------------------------------------------------------------------------------------------- | | `userId` | integer | No | UserId, One Of UserId\|Email\|ExternalUserId Needed | | `email` | string | No | Email, One Of UserId\|Email\|ExternalUserId Needed | | `externalUserId` | string | No | ExternalUserId, One Of UserId\|Email\|ExternalUserId Needed | | `productId` | integer | No | Id of product, default product will use if productId not specified and subscriptionId is blank | | `reloadCache` | boolean | No | | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/metric/user/metric" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/metric/user/metric" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.userMetric` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Query User Metric By Subscription Source: https://docs.unibee.dev/api-reference/user-metric/query-user-metric-by-subscription get /merchant/metric/user/sub/metric ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/metric/user/sub/metric` Query User Metric By Subscription *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ---------------- | ------- | -------- | -------------- | | `subscriptionId` | string | No | SubscriptionId | | `reloadCache` | boolean | No | | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/metric/user/sub/metric" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/metric/user/sub/metric" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.userMetric` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Change User Default Gateway Source: https://docs.unibee.dev/api-reference/user/change-user-default-gateway post /merchant/user/change_gateway ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/user/change_gateway` Change User Default Gateway *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | -------------------- | ------- | -------- | ------------------------------------------------------------------------------------------------- | | `gatewayId` | integer | Yes | GatewayId | | `gatewayPaymentType` | string | No | GatewayPaymentType | | `gatewayUserId` | string | No | GatewayUserId, verify and save GatewayUserId via gateway | | `paymentMethodId` | string | No | PaymentMethodId of gateway, available for card type gateway, payment automatic will enable if set | | `userId` | integer | Yes | User Id | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/user/change_gateway" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "gatewayId": 0, "gatewayPaymentType": "", "gatewayUserId": "id_example", "paymentMethodId": "id_example", "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/user/change_gateway" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "gatewayId": 0, "gatewayPaymentType": "", "gatewayUserId": "id_example", "paymentMethodId": "id_example", "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Change User Email Source: https://docs.unibee.dev/api-reference/user/change-user-email post /merchant/user/change_email ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/user/change_email` Change User Email *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------- | ------- | -------- | ------------------------------------------------------------------ | | `externalUserId` | string | No | The externalUserId of user, either ExternalUserId or UserId needed | | `newEmail` | string | Yes | Target Email want to change | | `userId` | integer | No | The id of user, either ExternalUserId or UserId needed | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/user/change_email" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalUserId": "id_example", "newEmail": "user@example.com", "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/user/change_email" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "externalUserId": "id_example", "newEmail": "user@example.com", "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Clear AutoCharge Method Source: https://docs.unibee.dev/api-reference/user/clear-autocharge-method post /merchant/user/clear_auto_charge_method ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/user/clear_auto_charge_method` Clear AutoCharge Method *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | -------- | ------- | -------- | -------------- | | `userId` | integer | Yes | The id of user | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/user/clear_auto_charge_method" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/user/clear_auto_charge_method" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Delete User Source: https://docs.unibee.dev/api-reference/user/delete-user post /merchant/user/delete ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/user/delete` Delete User *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------- | ------- | -------- | ------------------------------------------------------------------------------------ | | `forceDelete` | boolean | No | Force delete, if true, will cancel all active subscriptions before deleting the user | | `userId` | integer | Yes | UserId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/user/delete" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "forceDelete": false, "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/user/delete" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "forceDelete": false, "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get User Admin Note List Source: https://docs.unibee.dev/api-reference/user/get-user-admin-note-list get /merchant/user/admin_note_list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/user/admin_note_list` Get User Admin Note List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | -------- | ------- | -------- | ------------------------------------------------------ | | `userId` | integer | Yes | The id of user, either ExternalUserId or UserId needed | | `page` | integer | No | Page, Start With 0 | | `count` | integer | No | Count Of Page | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/user/admin_note_list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/user/admin_note_list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ---------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.noteLists` | array | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get User Admin Note List Source: https://docs.unibee.dev/api-reference/user/get-user-admin-note-list-1 post /merchant/user/admin_note_list ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/user/admin_note_list` Get User Admin Note List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | -------- | ------- | -------- | ------------------------------------------------------ | | `count` | integer | No | Count Of Page | | `page` | integer | No | Page, Start With 0 | | `userId` | integer | Yes | The id of user, either ExternalUserId or UserId needed | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/user/admin_note_list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "count": 0, "page": 0, "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/user/admin_note_list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "count": 0, "page": 0, "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ---------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.noteLists` | array | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get User Profile Source: https://docs.unibee.dev/api-reference/user/get-user-profile get /merchant/user/get ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/user/get` Get User Profile *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | -------- | ------- | -------- | ----------- | | `userId` | integer | Yes | UserId | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/user/get" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/user/get" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.user` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # New Admin Note Source: https://docs.unibee.dev/api-reference/user/new-admin-note post /merchant/user/new_admin_note ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/user/new_admin_note` New Admin Note *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | -------- | ------- | -------- | ------------------------------------------------------ | | `note` | string | Yes | Note | | `userId` | integer | Yes | The id of user, either ExternalUserId or UserId needed | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/user/new_admin_note" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "note": "", "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/user/new_admin_note" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "note": "", "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # New User Source: https://docs.unibee.dev/api-reference/user/new-user post /merchant/user/new User Creation If Not Exist ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/user/new` User Creation If Not Exist *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------- | ------ | -------- | -------------- | | `address` | string | No | Address | | `email` | string | Yes | Email | | `externalUserId` | string | No | ExternalUserId | | `firstName` | string | No | First Name | | `language` | string | No | Language | | `lastName` | string | No | Last Name | | `password` | string | No | Password | | `phone` | string | No | Phone | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/user/new" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "address": "", "email": "user@example.com", "externalUserId": "id_example", "firstName": "", "language": "", "lastName": "", "password": "", "phone": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/user/new" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "address": "", "email": "user@example.com", "externalUserId": "id_example", "firstName": "", "language": "", "lastName": "", "password": "", "phone": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.user` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Resume User Source: https://docs.unibee.dev/api-reference/user/resume-user post /merchant/user/resume_user ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/user/resume_user` Resume User *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | -------- | ------- | -------- | ----------- | | `userId` | integer | No | UserId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/user/resume_user" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/user/resume_user" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Suspend User Source: https://docs.unibee.dev/api-reference/user/suspend-user post /merchant/user/suspend_user ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/user/suspend_user` Suspend User *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | -------- | ------- | -------- | ----------- | | `userId` | integer | No | UserId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/user/suspend_user" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/user/suspend_user" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Update User Profile Source: https://docs.unibee.dev/api-reference/user/update-user-profile post /merchant/user/update ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/user/update` Update User Profile *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | -------------------- | ------- | -------- | ------------------------------------------------------------------------------------------------- | | `LinkedIn` | string | No | LinkedIn | | `address` | string | No | Billing Address | | `city` | string | No | city | | `companyName` | string | No | Company Name | | `countryCode` | string | No | Country Code | | `countryName` | string | No | Country Name | | `email` | string | No | The email of user, either Email or UserId needed | | `externalUserId` | string | No | ExternalUserId | | `facebook` | string | No | Facebook | | `firstName` | string | No | First name | | `gatewayId` | integer | No | GatewayId | | `gatewayPaymentType` | string | No | Gateway Payment Type | | `language` | string | No | User Language, en\|ru\|cn\|vi\|bp | | `lastName` | string | No | Last Name | | `metadata` | object | No | Metadata,Map | | `otherSocialInfo` | string | No | Other Social Info | | `paymentMethodId` | string | No | PaymentMethodId of gateway, available for card type gateway, payment automatic will enable if set | | `phone` | string | No | Phone | | `registrationNumber` | string | No | RegistrationNumber | | `state` | string | No | State | | `telegram` | string | No | Telegram | | `tiktok` | string | No | Tiktok | | `type` | integer | No | User type, 1-Individual\|2-Business | | `userId` | integer | No | The id of user, either Email or UserId needed | | `vATNumber` | string | No | VAT Number | | `weChat` | string | No | WeChat | | `whatsApp` | string | No | WhatsApp | | `zipCode` | string | No | zip\_code | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/user/update" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "LinkedIn": "", "address": "", "city": "", "companyName": "", "countryCode": "", "countryName": "", "email": "user@example.com", "externalUserId": "id_example", "facebook": "", "firstName": "", "gatewayId": 0, "gatewayPaymentType": "", "language": "", "lastName": "", "metadata": {}, "otherSocialInfo": "", "paymentMethodId": "id_example", "phone": "", "registrationNumber": "", "state": "", "telegram": "", "tiktok": "", "type": 0, "userId": 0, "vATNumber": "", "weChat": "", "whatsApp": "", "zipCode": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/user/update" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "LinkedIn": "", "address": "", "city": "", "companyName": "", "countryCode": "", "countryName": "", "email": "user@example.com", "externalUserId": "id_example", "facebook": "", "firstName": "", "gatewayId": 0, "gatewayPaymentType": "", "language": "", "lastName": "", "metadata": {}, "otherSocialInfo": "", "paymentMethodId": "id_example", "phone": "", "registrationNumber": "", "state": "", "telegram": "", "tiktok": "", "type": 0, "userId": 0, "vATNumber": "", "weChat": "", "whatsApp": "", "zipCode": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.user` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # User Count Source: https://docs.unibee.dev/api-reference/user/user-count get /merchant/user/count ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/user/count` User Count *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ----------------- | ------- | -------- | ------------------------------------- | | `createTimeStart` | integer | No | CreateTimeStart,UTC timestamp,seconds | | `createTimeEnd` | integer | No | CreateTimeEnd,UTC timestamp,seconds | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/user/count" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/user/count" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------ | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # User List Source: https://docs.unibee.dev/api-reference/user/user-list get /merchant/user/list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/user/list` User List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ----------------- | ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `userId` | integer | No | Filter UserId | | `externalUserId` | string | No | ExternalUserId | | `firstName` | string | No | Search FirstName | | `lastName` | string | No | Search LastName | | `email` | string | No | Search Filter Email | | `searchKey` | string | No | Search FirstName\|LastName\|Email\|Phone\|Address\|ExternalUserId | | `planIds` | array | No | PlanIds, Search Filter PlanIds | | `gatewayIds` | array | No | GatewayIds, Search Filter GatewayIds | | `subscriptionId` | string | No | Search Filter SubscriptionId | | `subStatus` | array | No | Filter, Default All,1-Pending|2-Active|3-Suspend \| 4-Cancel \| 5-Expire \| 6- Suspend\| 7-Incomplete \| 8-Processing \| 9-Failed | | `status` | array | No | Status, 0-Active|2-Frozen | | `deleteInclude` | boolean | No | Deleted Involved,Need Admin | | `sortField` | string | No | Sort,user\_id\|gmt\_create\|email\|user\_name\|subscription\_name\|subscription\_status\|payment\_method\|recurring\_amount\|billing\_type,Default gmt\_create | | `sortType` | string | No | Sort Type,asc\|desc,Default desc | | `page` | integer | No | Page,Start 0 | | `count` | integer | No | Count OF Page | | `createTimeStart` | integer | No | CreateTimeStart,UTC timestamp,seconds | | `createTimeEnd` | integer | No | CreateTimeEnd,UTC timestamp,seconds | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/user/list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/user/list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.total` | integer | Total | | `data.userAccounts` | array | User Account Object List | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # User List Source: https://docs.unibee.dev/api-reference/user/user-list-1 post /merchant/user/list ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/user/list` User List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------------- | ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `count` | integer | No | Count OF Page | | `createTimeEnd` | integer | No | CreateTimeEnd,UTC timestamp,seconds | | `createTimeStart` | integer | No | CreateTimeStart,UTC timestamp,seconds | | `deleteInclude` | boolean | No | Deleted Involved,Need Admin | | `email` | string | No | Search Filter Email | | `externalUserId` | string | No | ExternalUserId | | `firstName` | string | No | Search FirstName | | `gatewayIds` | array | No | GatewayIds, Search Filter GatewayIds | | `lastName` | string | No | Search LastName | | `page` | integer | No | Page,Start 0 | | `planIds` | array | No | PlanIds, Search Filter PlanIds | | `searchKey` | string | No | Search FirstName\|LastName\|Email\|Phone\|Address\|ExternalUserId | | `sortField` | string | No | Sort,user\_id\|gmt\_create\|email\|user\_name\|subscription\_name\|subscription\_status\|payment\_method\|recurring\_amount\|billing\_type,Default gmt\_create | | `sortType` | string | No | Sort Type,asc\|desc,Default desc | | `status` | array | No | Status, 0-Active|2-Frozen | | `subStatus` | array | No | Filter, Default All,1-Pending|2-Active|3-Suspend \| 4-Cancel \| 5-Expire \| 6- Suspend\| 7-Incomplete \| 8-Processing \| 9-Failed | | `subscriptionId` | string | No | Search Filter SubscriptionId | | `userId` | integer | No | Filter UserId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/user/list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "count": 0, "createTimeEnd": 0, "createTimeStart": 0, "deleteInclude": false, "email": "user@example.com", "externalUserId": "id_example", "firstName": "", "gatewayIds": [], "lastName": "", "page": 0, "planIds": [], "searchKey": "", "sortField": "", "sortType": "", "status": [], "subStatus": [], "subscriptionId": "id_example", "userId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/user/list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "count": 0, "createTimeEnd": 0, "createTimeStart": 0, "deleteInclude": false, "email": "user@example.com", "externalUserId": "id_example", "firstName": "", "gatewayIds": [], "lastName": "", "page": 0, "planIds": [], "searchKey": "", "sortField": "", "sortType": "", "status": [], "subStatus": [], "subscriptionId": "id_example", "userId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.total` | integer | Total | | `data.userAccounts` | array | User Account Object List | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # User Search Source: https://docs.unibee.dev/api-reference/user/user-search get /merchant/user/search ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/user/search` User Search *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ----------- | ------ | -------- | -------------------------------------------------------------------------------------------------------------- | | `searchKey` | string | No | SearchKey, Will Search UserId\|Email\|UserName\|CompanyName\|SubscriptionId\|VatNumber\|InvoiceId\|\|PaymentId | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/user/search" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/user/search" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.userAccounts` | array | UserAccounts | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # User Search Source: https://docs.unibee.dev/api-reference/user/user-search-1 post /merchant/user/search ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/user/search` User Search *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------- | ------ | -------- | -------------------------------------------------------------------------------------------------------------- | | `searchKey` | string | No | SearchKey, Will Search UserId\|Email\|UserName\|CompanyName\|SubscriptionId\|VatNumber\|InvoiceId\|\|PaymentId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/user/search" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "searchKey": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/user/search" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "searchKey": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.userAccounts` | array | UserAccounts | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get US Vat Category List Source: https://docs.unibee.dev/api-reference/vat-gateway/get-us-vat-category-list get /merchant/vat/us_vat_category_list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/vat/us_vat_category_list` Get US Vat Category List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/vat/us_vat_category_list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/vat/us_vat_category_list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.categoryList` | array | CategoryList | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Vat Country List Source: https://docs.unibee.dev/api-reference/vat-gateway/get-vat-country-list get /merchant/vat/country_list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/vat/country_list` Get Vat Country List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/vat/country_list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/vat/country_list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.vatCountryList` | array | VatCountryList | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Vat Country List Source: https://docs.unibee.dev/api-reference/vat-gateway/get-vat-country-list-1 post /merchant/vat/country_list ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/vat/country_list` Get Vat Country List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/vat/country_list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{}' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/vat/country_list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{}' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | --------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.vatCountryList` | array | VatCountryList | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Init Default Vat Gateway Source: https://docs.unibee.dev/api-reference/vat-gateway/init-default-vat-gateway post /merchant/vat/init_default_gateway ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/vat/init_default_gateway` Init Default Vat Gateway *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/vat/init_default_gateway" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{}' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/vat/init_default_gateway" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{}' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # US Vat Config Setup Source: https://docs.unibee.dev/api-reference/vat-gateway/us-vat-config-setup post /merchant/vat/setup_global_us_vat_config ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/vat/setup_global_us_vat_config` US Vat Config Setup *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------------- | ------ | -------- | ----------- | | `global_us_vat_config` | string | No | | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/vat/setup_global_us_vat_config" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "global_us_vat_config": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/vat/setup_global_us_vat_config" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "global_us_vat_config": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # US Vat Gateway Setup Source: https://docs.unibee.dev/api-reference/vat-gateway/us-vat-gateway-setup post /merchant/vat/setup_us_vat_gateway ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/vat/setup_us_vat_gateway` US Vat Gateway Setup *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------- | ------- | -------- | -------------------------- | | `apiKeys` | string | No | | | `gatewayName` | string | Yes | GatewayName, em. TaxJar | | `isDefault` | boolean | No | IsDefault, default is true | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/vat/setup_us_vat_gateway" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "apiKeys": "", "gatewayName": "", "isDefault": false }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/vat/setup_us_vat_gateway" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "apiKeys": "", "gatewayName": "", "isDefault": false }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Validate US Vat Address Source: https://docs.unibee.dev/api-reference/vat-gateway/validate-us-vat-address post /merchant/vat/us_vat_validate_address ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/vat/us_vat_validate_address` Validate US Vat Address *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | --------- | ------ | -------- | ----------- | | `address` | string | No | | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/vat/us_vat_validate_address" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "address": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/vat/us_vat_validate_address" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "address": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ---------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.addresses` | array | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Vat Gateway Setup Source: https://docs.unibee.dev/api-reference/vat-gateway/vat-gateway-setup post /merchant/vat/setup_gateway ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/vat/setup_gateway` Vat Gateway Setup *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------- | ------- | -------- | -------------------------- | | `IsDefault` | boolean | No | IsDefault, default is true | | `data` | string | Yes | Data | | `gatewayName` | string | Yes | GatewayName, em. vatsense | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/vat/setup_gateway" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "IsDefault": false, "data": "", "gatewayName": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/vat/setup_gateway" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "IsDefault": false, "data": "", "gatewayName": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.data` | string | The hide star data | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Vat Number Validation Source: https://docs.unibee.dev/api-reference/vat-gateway/vat-number-validation post /merchant/vat/vat_number_validate ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/vat/vat_number_validate` Vat Number Validation *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------- | ------ | -------- | ----------- | | `vatNumber` | string | Yes | VatNumber | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/vat/vat_number_validate" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "vatNumber": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/vat/vat_number_validate" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "vatNumber": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------------ | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.vatNumberValidate` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Vat Number Validation History Source: https://docs.unibee.dev/api-reference/vat-gateway/vat-number-validation-history post /merchant/vat/vat_number_validate_history ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/vat/vat_number_validate_history` Vat Number Validation History *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------------- | ------- | -------- | ------------------------------------------------------------------------- | | `count` | integer | No | Count Of Per Page | | `countryCode` | string | No | CountryCode | | `createTimeEnd` | integer | No | CreateTimeEnd,UTC timestamp,seconds | | `createTimeStart` | integer | No | CreateTimeStart,UTC timestamp,seconds | | `page` | integer | No | Page, Start 0 | | `searchKey` | string | No | Search Key, vatNumber, validateGateway, company, company address, message | | `sortField` | string | No | Sort Field,gmt\_create\|gmt\_modify,Default gmt\_modify | | `sortType` | string | No | Sort Type,asc\|desc,Default desc | | `status` | array | No | status, 0-Invalid,1-Valid | | `validateGateway` | string | No | Filter Validate Gateway, vatsense | | `vatNumber` | string | No | Filter Vat Number | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/vat/vat_number_validate_history" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "count": 0, "countryCode": "", "createTimeEnd": 0, "createTimeStart": 0, "page": 0, "searchKey": "", "sortField": "", "sortType": "", "status": [], "validateGateway": "id_example", "vatNumber": "" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/vat/vat_number_validate_history" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "count": 0, "countryCode": "", "createTimeEnd": 0, "createTimeStart": 0, "page": 0, "searchKey": "", "sortField": "", "sortType": "", "status": [], "validateGateway": "id_example", "vatNumber": "" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | -------------------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.numberValidateHistoryList` | array | NumberValidateHistoryList | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Vat Number Validation History Activate Source: https://docs.unibee.dev/api-reference/vat-gateway/vat-number-validation-history-activate post /merchant/vat/vat_number_validate_history_activate ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/vat/vat_number_validate_history_activate` Vat Number Validation History Activate *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ---------------- | ------- | -------- | ---------------- | | `companyAddress` | string | No | company\_address | | `companyName` | string | No | company\_name | | `countryCode` | string | No | CountryCode | | `historyId` | integer | No | History Id | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/vat/vat_number_validate_history_activate" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "companyAddress": "", "companyName": "", "countryCode": "", "historyId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/vat/vat_number_validate_history_activate" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "companyAddress": "", "companyName": "", "countryCode": "", "historyId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Vat Number Validation History Deactivate Source: https://docs.unibee.dev/api-reference/vat-gateway/vat-number-validation-history-deactivate post /merchant/vat/vat_number_validate_history_deactivate ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/vat/vat_number_validate_history_deactivate` Vat Number Validation History Deactivate *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------- | ------- | -------- | ----------- | | `historyId` | integer | No | History Id | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/vat/vat_number_validate_history_deactivate" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "historyId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/vat/vat_number_validate_history_deactivate" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "historyId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Delete Webhook Endpoint Source: https://docs.unibee.dev/api-reference/webhook/delete-webhook-endpoint post /merchant/webhook/delete_endpoint ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/webhook/delete_endpoint` Delete Webhook Endpoint *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------ | ------- | -------- | ----------- | | `endpointId` | integer | Yes | EndpointId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/webhook/delete_endpoint" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "endpointId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/webhook/delete_endpoint" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "endpointId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get US VAT Upload History List Source: https://docs.unibee.dev/api-reference/webhook/get-us-vat-upload-history-list get /merchant/vat/us_vat_upload_history_list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/vat/us_vat_upload_history_list` Get US VAT Upload History List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ------------- | ------- | -------- | ------------------------------------------------------- | | `invoiceId` | string | No | Invoice Id | | `gatewayName` | string | No | GatewayName, em. TaxJar | | `uploadType` | array | No | UploadType, PaymentUpload or RefundUpload, default both | | `page` | integer | No | Page, Start With 0 | | `count` | integer | No | Count Of Page | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/vat/us_vat_upload_history_list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/vat/us_vat_upload_history_list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------------ | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.historyList` | array | HistoryList | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Webhook Endpoint list Source: https://docs.unibee.dev/api-reference/webhook/get-webhook-endpoint-list get /merchant/webhook/endpoint_list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/webhook/endpoint_list` Get Webhook Endpoint list *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/webhook/endpoint_list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/webhook/endpoint_list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.endpointList` | array | EndpointList | | `data.zapierCredential` | object | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Webhook Endpoint Log List Source: https://docs.unibee.dev/api-reference/webhook/get-webhook-endpoint-log-list get /merchant/webhook/endpoint_log_list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/webhook/endpoint_log_list` Get Webhook Endpoint Log List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Query parameters | Name | Type | Required | Description | | ------------ | ------- | -------- | ------------------ | | `endpointId` | integer | Yes | EndpointId | | `page` | integer | No | Page, Start With 0 | | `count` | integer | No | Count Of Page | *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/webhook/endpoint_log_list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/webhook/endpoint_log_list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ---------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.endpointLogList` | array | EndpointLogList | | `data.total` | integer | Total | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Webhook Secret Source: https://docs.unibee.dev/api-reference/webhook/get-webhook-secret get /merchant/webhook/get_webhook_secret ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/webhook/get_webhook_secret` Get Webhook Secret *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/webhook/get_webhook_secret" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/webhook/get_webhook_secret" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.secret` | string | | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Get Webhook Zapier Connect Url Source: https://docs.unibee.dev/api-reference/webhook/get-webhook-zapier-connect-url post /merchant/webhook/webhook_zapier_connect_url ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/webhook/webhook_zapier_connect_url` Get Webhook Zapier Connect Url *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ----------- | ------ | -------- | ---------------------------------- | | `returnUrl` | string | No | ReturnUrl When Webhook Zapier back | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/webhook/webhook_zapier_connect_url" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "returnUrl": "https://example.com" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/webhook/webhook_zapier_connect_url" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "returnUrl": "https://example.com" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.zapierConnectUrl` | string | Zapier Connect Url | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # New Webhook Endpoint Source: https://docs.unibee.dev/api-reference/webhook/new-webhook-endpoint post /merchant/webhook/new_endpoint ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/webhook/new_endpoint` New Webhook Endpoint *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------ | ------ | -------- | ------------------------------------------------------------------------------ | | `events` | array | No | Events | | `productIds` | array | No | Optional product ids filter, empty means all products, 0 means default product | | `url` | string | Yes | Url | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/webhook/new_endpoint" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "events": [], "productIds": [], "url": "https://example.com" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/webhook/new_endpoint" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "events": [], "productIds": [], "url": "https://example.com" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Remove Webhook Zapier Connnect Source: https://docs.unibee.dev/api-reference/webhook/remove-webhook-zapier-connnect post /merchant/webhook/remove_webhook_zapier_connect ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/webhook/remove_webhook_zapier_connect` Remove Webhook Zapier Connnect *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/webhook/remove_webhook_zapier_connect" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{}' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/webhook/remove_webhook_zapier_connect" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{}' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Resent Webhook Source: https://docs.unibee.dev/api-reference/webhook/resent-webhook post /merchant/webhook/resend ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/webhook/resend` Resent Webhook *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------- | ------- | -------- | ----------- | | `logId` | integer | Yes | LogId | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/webhook/resend" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "logId": 0 }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/webhook/resend" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "logId": 0 }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ----------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.sendResult` | boolean | SendResult | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Update Webhook Endpoint Source: https://docs.unibee.dev/api-reference/webhook/update-webhook-endpoint post /merchant/webhook/update_endpoint ## Endpoint Overview **POST** `https://api.unibee.dev/merchant/webhook/update_endpoint` Update Webhook Endpoint *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Parameters for this endpoint are listed below. The schema is also shown in the Try it panel. ### Request body | Name | Type | Required | Description | | ------------ | ------- | -------- | --------------------------------------------------------------------------------------------------- | | `endpointId` | integer | Yes | EndpointId | | `events` | array | No | Events To Update | | `productIds` | array | No | Optional product ids filter, nil means no change, empty means all products, 0 means default product | | `url` | string | Yes | Url To Update | *** ## Request examples ### cURL ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/webhook/update_endpoint" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "endpointId": 0, "events": [], "productIds": [], "url": "https://example.com" }' ``` ### Sandbox ```bash theme={null} curl -X POST "https://api-sandbox.unibee.top/merchant/webhook/update_endpoint" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "endpointId": 0, "events": [], "productIds": [], "url": "https://example.com" }' ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. The response schema for this endpoint is shown below. *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Webhook Event List Source: https://docs.unibee.dev/api-reference/webhook/webhook-event-list get /merchant/webhook/event_list ## Endpoint Overview **GET** `https://api.unibee.dev/merchant/webhook/event_list` Webhook Event List *** ## Authorization All UniBee Merchant API requests require authentication via API key. | Header | Required | Description | | --------------- | -------- | ------------------------------------- | | `Authorization` | Yes | Bearer `` | | `Content-Type` | Yes | `application/json` (for request body) | *** ## Parameters Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. Path, query, and request body parameters are defined in the schema below. Use the interactive Try it panel to see the full request structure. *** ## Request examples ### cURL ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/webhook/event_list" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Sandbox ```bash theme={null} curl -X GET "https://api-sandbox.unibee.top/merchant/webhook/event_list" \ -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \ -H "Content-Type: application/json" ``` *** ## Response Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success. | Field | Type | Description | | ---------------- | ------- | ---------------------------- | | `code` | integer | Response code. `0` = success | | `data` | object | Response payload | | `data.eventList` | array | EventList | | `message` | string | Human-readable message | | `requestId` | string | Request ID for support | *** ## Error handling | HTTP status | Meaning | | ----------- | ------------------------------------------------------------------------- | | 400 | Bad request — invalid or missing parameters. Check `message` in the body. | | 401 | Unauthorized — missing or invalid API key. | | 404 | Not found — invalid path or resource. | | 500 | Server error — retry with backoff. | When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support. # Activity logs Source: https://docs.unibee.dev/documentation/admin-management/activity-logs ## Billing admin activity logs In the "Activity Log" section, you can view a comprehensive list of events performed by billing admins, including detailed descriptions and timestamps. Features include: * **Search and Filter:** Easily search for activities by specific admins. * **Detailed Search:** Filter activities by Subscription ID, Invoice ID, Plan ID, and Discount Code. The Activity Logs feature enables business owners to effectively manage billing admin operations and analyze the reasons behind billing-related events. # Define roles and permissions for billing admins Source: https://docs.unibee.dev/documentation/admin-management/define-roles-permissions * As the admin portal owner, you can navigate to the "Configuration - Admin Permission" tab * Here you can define billing admin roles and assign access to the roles * Click the "Add" button on the right side of the table * A new role will be added to the list * Input the name of the role and choose which function zones this role can access * Click the "Save" button on the right side of this role * If you want to delete this role, click the "Remove" button on the right side of the role and click "Yes" on the "Deletion Confirm" window * Please be aware that if there are billing admins on the role that you want to delete, you must remove these billing admins from other roles. # Invite more billing admins Source: https://docs.unibee.dev/documentation/admin-management/invite-more-billing-admins * To invite more team members to join your billing portal, follow these steps: * Navigate to the Admin List tab. * Click the "Invite Member" button on the right side of the list. * Enter the First Name and Last Name of the billing admin. * Enter the billing admin’s Email Address. * From the "Roles" drop-down list, select the role(s) you want to assign to the billing admin. Note that a billing admin can have multiple roles in UniBee. * Click "Invite". An invitation email with instructions will be sent to your team member. # Analytics Overview Source: https://docs.unibee.dev/documentation/analytics/analytics-overview Unified subscription analytics for revenue, customer value, retention, and configuration. # Analytics Overview ## Analytics Analytics provides a unified view of your subscription business, helping you understand revenue performance, customer value, and retention — all in one place. Built on top of your billing data, Analytics combines **subscription-based metrics, flexible calculation logic, and drill-down analysis**, so teams can not only see what changed, but also understand why it changed. The Analytics module includes: * **Revenue Metrics**\ Track recurring revenue and retention through MRR, ARR, Net Revenue, and NRR. * **Customer Metrics**\ Measure customer value and lifecycle performance with Customer LTV. * **Configurable Settings**\ Customize how metrics are calculated, what data is included, and how reports are displayed. With both high-level summaries and detailed breakdowns, Analytics enables product, finance, and growth teams to make more informed decisions based on consistent and transparent data. # Configurable Settings Source: https://docs.unibee.dev/documentation/analytics/configurable-settings General, MRR metrics configuration, data scope, visibility, and recalculation in Analytics. # Configurable Settings The **Settings** page allows admins to configure how Analytics works. It includes four tabs: * **General** – manage base settings such as currency and product scope * **MRR Metrics Configuration** – adjust how selected MRR-related metrics are calculated * **Data Scope Adjustment** – exclude users or plans that should not affect analytics results * **Metrics Visibility Settings** – choose which sections and fields are shown in reports Some changes require recalculation before updated results appear in Analytics. ## General The **General** tab contains basic Analytics settings, including: * **Base Currency** * **Current Product** Use **Save** to keep changes.\ If a change affects analytics results, use **Apply and Re-calculate** to update the reports. ## MRR Metrics Configuration The **MRR Metrics Configuration** tab allows admins to adjust how selected MRR-related metrics are interpreted in Analytics. It includes settings for: * **New MRR Calculation** * **Reactivation and Churn Calculation** * **Refund Adjustment Calculation** * **Discount Adjustment Calculation** These settings help businesses align Analytics with their own reporting preferences. ## Data Scope Adjustment The **Data Scope Adjustment** tab controls which records should be included in Analytics. It includes options such as: * **Email Domain Exclusion** * **Email Exclusion** * **Non-Recurring Adjustment** * **Analytics Scope Exclusion** This is useful for removing internal, test, or non-business records from analytics reports. ## Metrics Visibility Settings The **Metrics Visibility Settings** tab controls which sections and fields are displayed in Analytics pages. Settings can be configured for different report areas, such as: * **MRR** * **ARR** * **Net Revenue** This helps teams simplify reports and focus on the metrics that matter most. ## Recalculation Some Settings changes do not take effect immediately. When a change affects calculation logic or data scope, Analytics may need to run a background recalculation before updated results appear in reports. Use **Apply and Re-calculate** when needed. # Customer Metrics Source: https://docs.unibee.dev/documentation/analytics/customer-metrics Customer LTV, quick cards, trend, breakdown, formulas, and notes in UniBee Analytics. # Customer Metrics # Customer LTV The **Customer LTV** page helps you estimate how much recurring revenue an average active customer is expected to generate over time. It combines customer count, average recurring revenue, and churn data into a simple monthly view, so teams can quickly understand whether customer value is improving or declining. *** ## What you can see ### Quick Cards At the top of the page, quick cards show Customer LTV values for key comparison points, such as: * Current month * 1 month ago * 3 months ago * 6 months ago * 12 months ago This helps you quickly compare recent and historical customer value. *** ### Customer LTV Trend The trend chart shows how **Recurring Revenue LTV** changes over time. Use it to: * monitor long-term changes in customer value * identify periods of improvement or decline * compare recent performance with past months *** ### Recurring Revenue LTV Breakdown The breakdown table shows the monthly components used in LTV calculation, including: * **Active Customers**\ Total number of active recurring customers included in MRR calculation. * **ARPC**\ Average recurring revenue per active customer. * **Customer Churn Rate**\ Percentage of customers who canceled or did not renew recurring subscriptions during the period. * **Lifetime Value (LTV)**\ Estimated recurring revenue an average customer is expected to generate before churning. * **MoM LTV Change**\ Month-over-month percentage change in LTV. This table helps you understand not only the final LTV result, but also the main drivers behind it. *** ## How Customer LTV is calculated ### Active Customers Number of active recurring customers included in MRR. ### ARPC **ARPC = MRR ÷ Active Customers** ARPC shows the average monthly recurring revenue per active customer. ### Customer Churn Rate **Customer Churn Rate = Lost Customers ÷ Starting Customers** It reflects how many recurring customers were lost during the selected period. ### Lifetime Value (LTV) **LTV = ARPC ÷ Customer Churn Rate** This estimates how much recurring revenue an average customer may generate before churning. ### MoM LTV Change **MoM LTV Change = (Current Month LTV - Prior Month LTV) ÷ Prior Month LTV × 100%** This shows whether customer value is increasing or decreasing compared with the previous month. *** ## Notes * This page focuses on **recurring revenue LTV** * LTV is shown in the reporting currency used in Analytics * Trend and table results follow the same MRR and churn logic configured in your Analytics setup *** ## Why it matters Customer LTV helps teams evaluate the long-term value of recurring customers. It is especially useful for: * tracking customer quality over time * comparing revenue per customer against churn * identifying whether customer value is becoming stronger or weaker # Revenue Metrics Source: https://docs.unibee.dev/documentation/analytics/revenue-metrics MRR, ARR, Net Revenue, and NRR in UniBee Analytics. # Revenue Metrics ## MRR The **MRR** page provides a dedicated view of your monthly recurring revenue in Analytics. It helps you track recurring revenue over time, understand how MRR changes from month to month, and investigate the customer or plan details behind those changes. MRR in Analytics focuses on **recurring subscription revenue**. It is designed to help teams monitor revenue trends, review month-over-month movement, and better understand the recurring side of the business. ### What you can do on this page On the MRR page, you can: * review your recurring revenue trend over time * compare MRR across recent months * see a monthly breakdown of MRR-related movements * drill down into customer-level details for a selected month * review plan-level contribution to MRR * check customer count trends related to recurring revenue * customize which modules are displayed on the page ### Main sections The MRR page includes several sections that work together to support both high-level monitoring and detailed analysis. #### Quick-view Cards At the top of the page, quick-view cards highlight MRR values for the current month and selected historical periods. These cards provide a fast summary of recent recurring revenue performance. #### MRR Trend The trend chart shows how MRR changes over time within the selected date range. This helps users quickly identify growth, decline, or unusual movement in recurring revenue. #### Monthly Breakdown The monthly breakdown table provides a structured view of MRR-related movements by month. It is useful for understanding how recurring revenue changes over time and for reviewing the main components behind those changes. #### MRR Detail For a selected month, users can drill down into customer-level MRR details. This helps teams investigate individual records and better understand which customers, plans, or subscriptions contributed to the selected result. #### MRR Customer Count This section provides customer-related recurring revenue counts and classifications by month. It can help teams monitor how customer activity is changing over time. #### MRR by Plans This section shows how different plans contribute to total MRR. It is useful for identifying which plans drive the most recurring revenue. ### Filters and drill-down The MRR page supports filters such as date range, product, and plan, allowing users to narrow the analysis to a specific business scope. Users can also drill down from summary views into more detailed records for further investigation. ### Display settings The MRR page supports **Display Settings**, which allow users to choose which sections and metrics should appear on the page. This helps different teams tailor the page based on their reporting needs. ### Notes * MRR reflects recurring revenue and does not represent one-time charges. * Values for the current month may continue to change before the month is complete. * Available sections and displayed metrics may vary depending on your Display Settings and Analytics configuration. *** ## ARR The **ARR** page shows annual recurring revenue in Analytics. It helps you monitor recurring revenue at the annual level, track ARR changes over time, and review ARR contribution by customers and plans. The page includes: * **Quick-view Cards** for key ARR summaries * **ARR Trend** for viewing ARR changes over time * **ARR Movements** for month-by-month ARR analysis * **ARR by Customers** for customer-level ARR contribution * **ARR by Plans** for plan-level ARR contribution You can also use **Display Settings** to control which sections and metrics are shown on the page. **Notes** * ARR includes recurring revenue only. * One-time payments are not included. * Available metrics may vary depending on your Analytics settings. *** ## Net Revenue The **Net Revenue** page shows adjusted revenue in Analytics. It helps you review revenue trends, compare total revenue and net revenue, analyze plan contribution, and drill down into detailed records. The page includes: * **Quick-view Cards** for recent net revenue snapshots * **Revenue Trend** for viewing revenue changes over time * **Monthly Breakdown** for period-by-period comparison * **Yearly Breakdown** for annual summary * **Revenue by Plans** for plan-level contribution analysis * **Revenue Detail** for detailed record review You can also use filters, export options, and **Display Settings** to tailor the page to your reporting needs. *** ## NRR The NRR page shows net revenue retention in Analytics. It helps you measure how recurring revenue from **existing customers** changes over time. NRR in Analytics follows the standard recurring-revenue definition. It excludes one-time payments, new customers, and reactivated customers in their reactivation month. ### Main sections The NRR page includes: * **Quick-view Cards** for recent NRR values * **NRR Trend** for viewing retention changes over time * **Monthly Breakdown** for Existing, Expansion, Contraction, Voluntary Churn, and Delinquent Churn * **NRR Detail** for customer-level drill-down from the monthly breakdown * **NRR by Plans** for plan-level retention analysis ### Notes * NRR is calculated for existing customers only. * When plan filters are used, they define the customer cohort at the start of the period. * Values for the current month may continue to change before the month is complete. # Work with charged-type metric Source: https://docs.unibee.dev/documentation/billable-metric/charged-metric Suitable for usage-based plans, It allows you to charge additional amounts based on actual usage, ensuring that your revenue matches customer engagement. The charged-type metric (numeric type) is used to track user usage, calculate and charge the amount at period end. The metric system integrates with the UniBee API, which provides event-based statistics. You can report usage data by sending events to the [Event API](/api-reference/metric-event/new-merchant-metric-event). The metric counting for each product, you may need specified for the `productId` at Event API, default product will used if not specified Aggregation Type of Count metric event, it increases 1 usage number ```shellscript theme={null} curl --location --request POST "$UniBee_API_Host/merchant/merchant_metric/merchant_metric_event" \ --header "Authorization: Bearer $YOUR_API_KEY" \ --header 'Content-Type: application/json' \ --data-raw '{ "metricCode": "folder_count_limit", // code needs to be configured in advance in the UniBee portal "externalUserId": "$YOUR_USER_ID", "externalEventId": "string", // string, **unique**, e.m. [folderId] "metricProperties": {} }' ``` same externalEventId , no double counting Aggregation Type of Latest metric event, it Inspect 5, event of Latest type will not be add up ```shellscript theme={null} curl --location --request POST "$UniBee_API_Host/merchant/merchant_metric/merchant_metric_event" \ --header "Authorization: Bearer $YOUR_API_KEY" \ --header 'Content-Type: application/json' \ --data-raw '{ "metricCode": "active_profile_limit", // code needs to be configured in advance in the UniBee portal "externalUserId": "$YOUR_USER_ID", "externalEventId": "string", // string, **unique**, e.m. [folderId] "metricProperties": { "active_profile": 5 } }' ``` ### Define how much cost for every event at Plan definision after complete set-up your billable metric * Go to the **Plan Definition** page * Navigate to **Advanced Setup**, add a billing model under **Usage-based billing**, and choose your **Pricing type**: * **Standard pricing** A fixed rate is applied for each unit of usage. For example, if the unit price is $0.05 and a user generates 100 events, they will be charged $5. * **Graduated pricing** Usage is divided into tiers, and each tier has a different rate. For example: * First 100 events: \$0.05 each * Next 200 events: \$0.03 each * Remaining events: \$0.01 each\ This model encourages higher usage by reducing unit costs at higher volumes. ### Check the customer's current metric statistics * Go to **User-Detail** Page at **UniBee Admin Portal** * Tab to **Metering-Usage** Page, check current billing period charged metered usage data * Charged metered usage amount will append to next invoice items automatically UniBee Customer Charged Metric Page # How To Create A UniBee Billable Metric Source: https://docs.unibee.dev/documentation/billable-metric/how-to-create-billable-metric \#How To Create A UniBee Billable Metric ## 1. Overview The **Billing Metric** module allows you to define and track billable business metrics such as API requests, storage usage, or AI token consumption.\ The redesigned interface introduces **template-based configuration**, **real-time previews**, and **clear contextual guidance** to make metric setup faster and more intuitive. ### 🎯 Key Benefits * **Lower learning curve** – friendly field names and contextual explanations * **Faster onboarding** – quick-start templates for common billing use cases * **Instant validation** – live event and aggregation previews * **Standardized model** – consistent flow: *Event → Metric → Aggregation → Billing* *** ## 2. Navigation Access this module from the sidebar: > **Product → Billable Metric** The main list view displays all existing metrics, including: * **Metric Name & Code** * **Aggregation Type** (Count / Sum / Max / Unique) * **Charge Type** (Charge Metered / Charge Recurring) * **Last Updated** * **Actions** (✏️ Edit / 🗑 Delete) *** ## 3. Create a New Metric Click **“+ New Metric”** to open the metric creation page. ### 3.1 Quick Templates Predefined templates are provided for common billing scenarios.\ Selecting a template will auto-fill key fields, but you can freely modify them. | Template | Purpose | Aggregation | Unit | | --------------- | ------------------------- | ----------- | -------- | | API Requests | Track API calls | Count | requests | | LLM Tokens | Track token usage | Sum | tokens | | Worker Duration | Track task duration | Sum | ms | | Storage GB | Track storage usage | Max | GB | | Emails Sent | Track sent emails | Count | emails | | Unique Users | Track active users | Unique | users | | Custom | Fully blank configuration | any | custom | *** ### 3.2 Basic Information | Field | Description | Required | | --------------- | ------------------------------------------------------ | -------- | | **Name** | Human-readable name (e.g. API Requests) | ✅ | | **Code / Slug** | Unique identifier generated from the name (editable) | ✅ | | **Description** | Optional explanation of the metric purpose | | | **Metric Type** | See [Metric Types Guide](#metric-type-selection) below | ✅ | | **Unit** | Unit of measure (e.g. requests, tokens, GB, ms) | ✅ | > 💡 The **Slug** auto-generates from the Name and must be unique. *** ### 3.2.1 Metric Type Selection When creating a metric, you must choose one of **four metric types**. This choice determines how usage is tracked and billed: #### Limit Metered * **Behavior**: Usage resets completely at the start of each billing cycle * **Quota**: Hard limit that rejects requests when exceeded * **Carryover**: No - unused quota is lost * **Best For**: Monthly allowances that reset (e.g., "1000 API calls per month") **Example**: ``` Month 1: 1000 units, used 800 → 200 unused (lost) Month 2: 1000 units (fresh start) ``` #### Limit Recurring ⭐ * **Behavior**: Usage resets, but unused quota carries over * **Quota**: Soft limit with automatic carryover * **Carryover**: Yes - unused quota is preserved * **Best For**: Prepaid credits (e.g., "1000 SMS credits per month") **Example**: ``` Month 1: 1000 units, used 700 → 300 unused (carries over) Month 2: 1000 base + 300 carryover = 1300 units total ``` #### Charge Metered * **Behavior**: Usage resets each cycle, charges based on consumption * **Billing**: Additional charges added to invoice at period end * **Reset**: Yes - usage resets to zero each period * **Best For**: Pay-per-use services (e.g., "\$0.10 per API call") **Example**: ``` Month 1: User makes 500 calls × $0.10 = $50 added to invoice Month 2: Usage resets, new billing cycle starts ``` #### Charge Recurring * **Behavior**: Usage accumulates continuously across periods * **Billing**: Charges based on total accumulated usage * **Reset**: No - usage never resets * **Best For**: Cumulative usage billing (e.g., total data usage) **Example**: ``` Month 1: 100 GB used Month 2: +50 GB (total: 150 GB) Month 3: +75 GB (total: 225 GB) ``` #### Quick Decision Guide | Need | Recommended Type | | ------------------------------------ | -------------------- | | Monthly quota that resets completely | **Limit Metered** | | Prepaid credits that accumulate | **Limit Recurring** | | Pay-per-use billing | **Charge Metered** | | Cumulative/lifetime usage | **Charge Recurring** | > 💡 **Not sure which type to choose?** See the detailed comparison in [What is Billable Metric?](./what-is-billable-metric) for more examples. *** ### 3.3 Event & Aggregation | Field | Description | | ---------------------- | ---------------------------------------------------------------------- | | **Aggregation** | Defines how data is summarized: Count / Sum / Max / Min / Unique Count | | **Value Property** | Numeric field path, required for Sum/Max/Min types | | **Distinct By** | Used for Unique Count (e.g. user\_id) | | **Labels to Group By** | Split usage by dimensions (e.g. region, plan, customer\_id) | #### Right-Side Preview Panel * **Event Example:** Live JSON event structure based on your form inputs * **Aggregation Preview:** Displays example calculations (e.g. `1 + 2 + 3 = 6` or `max(10, 20, 30) = 30`) * **Quick Snippet:** Auto-generated cURL / SDK example for developer use * **Test It:** Simulate an event and preview real-time calculation results > Highlight the right-side panels in color (Event Example – green, Aggregation Preview – blue, Quick Snippet – yellow). *** ## 4. API Integration — New Merchant Metric Event Developers can send event data to UniBee [Event API](/api-reference/metric-event/new-merchant-metric-event) for automatic metric aggregation and billing. ### Endpoint # Work with Limit Recurring Metric Source: https://docs.unibee.dev/documentation/billable-metric/limit-recurring-metric Limit Recurring metrics carry over unused quota from previous billing cycles, ideal for prepaid credits and allowances. # Work with Limit Recurring Metric ## Overview **Limit Recurring** is a metric type designed for prepaid credits and allowances where unused quota has value and should be preserved across billing cycles. Unlike **Limit Metered** which resets completely each month, Limit Recurring automatically carries over unused quota to the next billing period. ### Key Features * ✅ **Automatic Carryover**: Unused quota automatically transfers to the next billing cycle * ✅ **Quota Accumulation**: Quota can accumulate over time if not fully used * ✅ **Manual Adjustments**: Administrators can manually adjust quota for compensation or corrections * ✅ **Transparent Tracking**: Complete breakdown showing quota sources (base plan, carryover, manual adjustments) *** ## How It Works ### Basic Concept **Limit Recurring** uses a "soft reset" approach: * Each billing cycle, you receive your base quota from the plan * Any unused quota from the previous cycle automatically carries over * Total available quota = Base quota + Carried over quota ### Example: Monthly SMS Credits ``` Month 1 (January) ├─ Base Quota: 1000 SMS credits (from plan) ├─ Used: 700 SMS └─ Remaining: 300 SMS ↓ Billing Cycle Renews (Automatic Carryover) Month 2 (February) ├─ Base Quota: 1000 SMS credits (from plan) ├─ Carried Over: +300 SMS (from January) └─ Total Available: 1300 SMS credits Month 2 Usage: ├─ Used: 900 SMS └─ Remaining: 400 SMS ↓ Next Renewal Month 3 (March) ├─ Base Quota: 1000 SMS credits ├─ Carried Over: +400 SMS (from February) └─ Total Available: 1400 SMS credits ``` *** ## When to Use Limit Recurring ### ✅ Perfect For: 1. **Prepaid Credits** * SMS credits * Phone call minutes * API credits * Any prepaid resource where unused amount has value 2. **Accumulative Allowances** * Monthly data allowances that accumulate * Storage quotas that build up * Feature credits that don't expire 3. **User-Friendly Models** * When customers should keep what they paid for * When unused quota represents value to the user * When you want to improve customer satisfaction ### ❌ Not Suitable For: * **Time-sensitive quotas** that should reset completely (use Limit Metered instead) * **Usage-based billing** where you charge per unit (use Charge Metered instead) * **Monthly fresh starts** where previous usage doesn't matter *** ## Comparison: Limit Metered vs Limit Recurring ### Scenario: 1000 Units Per Month #### Limit Metered (Hard Reset) ``` Month 1: 1000 units - Used: 700 - Unused: 300 ❌ Lost at month end Month 2: 1000 units (fresh start) - User starts with exactly 1000 units ``` **Best for**: Monthly allowances where unused quota doesn't matter (e.g., API rate limits) #### Limit Recurring (Soft Reset with Carryover) ``` Month 1: 1000 units - Used: 700 - Unused: 300 ✅ Carries forward Month 2: 1000 base + 300 carryover = 1300 units - User starts with 1300 units ``` **Best for**: Prepaid credits where unused amount has value (e.g., SMS credits) *** ## Quota Sources and Breakdown Your total available quota comes from three sources: ### 1. Base Plan Limit The quota amount defined in your subscription plan for the current billing period. **Example**: Gold Plan includes 1000 SMS credits per month ### 2. Automatic Carryover Unused quota from the previous billing period, automatically calculated and transferred. **Example**: * Previous period: 1300 total, used 800 * Carryover: +500 credits ### 3. Manual Adjustments Administrator adjustments for compensation, corrections, or special cases. **Example**: * Compensation for service outage: +200 credits * Correction for billing error: -50 credits ### Total Quota Calculation ``` Total Available = Base Plan + Carried Over + Manual Adjustments ``` **Example**: ``` Base Plan: 1,000 credits Carried Over: + 500 credits Manual Adjustment: + 200 credits ──────────────────────────────────── Total Available: 1,700 credits ``` *** ## Viewing Your Quota ### User Dashboard When viewing your usage, you'll see: ``` 📞 SMS Credits ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 800 / 1,700 credits used Quota Breakdown: ├─ Base Plan 1,000 credits ├─ Carried Over 500 credits ⓘ └─ Admin Adjustment 200 credits ⓘ Current Period: Jan 1 - Jan 31, 2025 ``` ### Quota Detail View Click on the info icon (ⓘ) to see detailed information: ``` Quota Detail - SMS Credits ════════════════════════════════════════════ Current Period (Jan 1 - 31, 2025) Total Limit: 1,700 credits Used: 800 credits Remaining: 900 credits ════════════════════════════════════════════ 🔹 Base Plan Limit Gold Plan: 1,000 credits 🔄 Carried Over from Previous Period └─ From December 2024 Previous Limit: 1,300 Previous Used: 800 Carried Over: 500 credits Date: Jan 1, 2025 ✏️ Manual Adjustments └─ Compensation for service outage Amount: +200 credits Adjusted by: Support Team Date: Jan 5, 2025 ``` *** ## Integration with Event API ### Reporting Usage You report usage the same way as other metric types using the [Event API](/api-reference/metric-event/new-merchant-metric-event): ```bash theme={null} curl --location --request POST "$UniBee_API_Host/merchant/merchant_metric/merchant_metric_event" \ --header "Authorization: Bearer $YOUR_API_KEY" \ --header 'Content-Type: application/json' \ --data-raw '{ "metricCode": "sms_credits", "externalUserId": "$YOUR_USER_ID", "externalEventId": "sms_20250105_001", "metricProperties": {} }' ``` ### Checking Quota The API response includes your current usage and total available quota: ```json theme={null} { "code": 0, "data": { "currentValue": 800, "totalLimit": 1700, "metricLimit": { "metricId": 123, "code": "sms_credits", "metricName": "SMS Credits", "type": 4, "totalLimit": 1700, "planLimits": [ { "planId": 50, "metricLimit": 1000 } ], "quotaAdjustments": [ { "id": 2, "quotaAmount": 500, "quotaType": "carryover", "reason": "Carry over from period 1704067200", "previousPeriodLimit": 1300, "previousPeriodUsed": 800, "adjustmentTime": 0 }, { "id": 4, "quotaAmount": 200, "quotaType": "manual", "reason": "Compensation for service outage", "adjustmentTime": 1704441600 } ] } } } ``` ### When Limit is Reached If you exceed your quota limit, the API will return an error: ```json theme={null} { "code": 51, "message": "metric limit reached, current used: 1700, limit: 1700", "data": {} } ``` ### Limit Boundary Behavior The system uses a **boundary-inclusive** check: when the usage plus the new event value **equals** the limit, the event is **allowed**. When it **exceeds** the limit, the event is **rejected**. **Examples**: * Limit = 1700, Current Used = 1690, Event Value = 10 → ✅ **Allowed** (1690 + 10 = 1700 ≤ 1700) * Limit = 1700, Current Used = 1690, Event Value = 11 → ❌ **Rejected** (1690 + 11 = 1701 > 1700) * Limit = 1700, Current Used = 1700, Event Value = 0 → ✅ **Allowed** (1700 + 0 = 1700 ≤ 1700) * Limit = 1700, Current Used = 1700, Event Value = 1 → ❌ **Rejected** (1700 + 1 = 1701 > 1700) *** ## Plan Limit and Quota Requirements ### Important: Plan Limit Must Be Configured **Limit Recurring** metrics require a Plan Limit to be configured. Quota adjustments (carryover and manual adjustments) **only take effect when a Plan Limit exists**. ### Behavior When Plan Limit is Deleted If the Plan Limit is deleted or not configured: 1. **Quota Adjustments Do Not Take Effect**: * Even if you have carryover quota or manual adjustments, they will not be applied * The system requires a base Plan Limit for quota adjustments to work 2. **All Events Are Rejected**: * All event creation attempts will be rejected * Error message: `"metric limit reached, current used: X, limit: 0"` * `limit: 0` indicates that no Plan Limit is configured **Why this behavior?** * Limit types (Limit Metered, Limit Recurring) require a limit binding to function correctly * Quota adjustments are designed to modify the base Plan Limit, not replace it * Without a Plan Limit, the system cannot determine the usage boundary **To resolve**: * Ensure the Plan Limit is properly configured in the plan definition * If you need to temporarily disable the metric, consider archiving the plan or removing the metric from the plan instead of deleting the Plan Limit ### Quota Adjustment Rules **Quota adjustments only work when Plan Limit exists**: | Scenario | Plan Limit | Quota | Behavior | | ------------------ | ---------------- | -------- | ------------------------------------------------- | | Normal operation | ✅ Exists | ✅ Exists | ✅ Quota is added to Plan Limit | | Plan Limit deleted | ❌ Deleted | ✅ Exists | ❌ Quota does not take effect, all events rejected | | No Plan Limit | ❌ Not configured | ✅ Exists | ❌ Quota does not take effect, all events rejected | **Example**: * Plan Limit: 1000 credits * Quota adjustment: +500 credits * **Total Limit**: 1500 credits ✅ If Plan Limit is deleted: * Quota adjustment: +500 credits * **Total Limit**: 0 (Quota does not apply) * **Result**: All events rejected ❌ *** ## Manual Quota Adjustments Administrators can manually adjust your quota for various reasons: ### Common Scenarios 1. **Service Compensation** * Service outage or downtime * Billing errors * Technical issues affecting usage 2. **Customer Support** * Goodwill gestures * Special promotions * Account corrections 3. **Business Adjustments** * Plan upgrades/downgrades * Credit transfers * Refund processing ### How It Works 1. Administrator logs into the admin portal 2. Navigates to your user or subscription details 3. Opens the Metrics tab 4. Selects the Limit Recurring metric 5. Clicks "Adjust Quota" 6. Enters adjustment amount (positive to increase, negative to decrease) 7. Provides a reason (required) 8. Submits the adjustment **Adjustment Rules**: * Adjustments can be positive (increase) or negative (decrease) * A reason is always required for audit purposes * Adjustments take effect immediately * All adjustments are logged with timestamp and operator *** ## Plan Upgrade and Downgrade Scenarios When you upgrade or downgrade your subscription plan, the system handles quota carryover differently depending on the type of upgrade. ### Normal Upgrade (Cross-Period Upgrade) **What happens**: * ✅ **Quota carryover**: Unused quota from the previous period is automatically carried over * ✅ **Usage preservation**: Previous period's usage data is preserved * ✅ **Base quota**: You receive the new plan's base quota * ✅ **Total calculation**: Total = New base quota + Carried over quota **Example**: ``` Period 1 (January) - Plan A ├─ Base Quota: 1000 credits ├─ Used: 700 credits └─ Remaining: 300 credits ↓ Normal Upgrade to Plan B (at period end) Period 2 (February) - Plan B ├─ Base Quota: 2000 credits (from Plan B) ├─ Carried Over: +300 credits (from Period 1) └─ Total Available: 2300 credits ``` **Key points**: * Upgrade happens at the end of a billing period * Full quota carryover is applied * All quota sources (plan limit, carryover, manual adjustments) are preserved ### Proration Upgrade (Mid-Period Upgrade) **What happens**: * ✅ **Quota carryover with refund adjustment**: Unused quota is **normally carried over**, but a refund adjustment is created to offset the plan limit portion (to avoid business loss since the old plan receives a refund) * ❌ **Usage does not carry over**: Usage data is **not** carried over to the new period (usage starts from 0, consistent with normal renewal) * ✅ **Base quota**: You receive the new plan's base quota for the remaining period * ✅ **Manual adjustments preserved**: Admin manual adjustments are carried over (protected user benefit) **Example**: ``` Period 1 (January 1-31) - Plan A ├─ Base Quota: 1000 credits (from Plan A) ├─ Admin Adjustment: +200 credits ├─ Previous Carryover: +50 credits ├─ Total Limit: 1250 credits ├─ Used: 500 credits └─ Remaining: 750 credits ↓ Proration Upgrade to Plan B (January 15) - Old plan refunded 50% of remaining period - Period End stays: January 31 - Period Start updates: January 15 Period 1 (January 15-31) - Plan B ├─ Base Quota: 2000 credits (from Plan B, prorated) ├─ Carried Over: +750 credits (normal carryover: 1250 - 500) ├─ Refund Adjustment: -1000 credits (offsets Plan A's plan limit) ├─ Total Available: 2000 + 750 - 1000 = 1750 credits └─ Usage: 0 credits (starts from 0, usage does not carry over) ``` **How it works**: * **Normal carryover**: All remaining quota (including plan limit, admin adjustments, and previous carryover) is carried over normally * **Refund adjustment**: A negative refund adjustment (`QuotaType: "proration_refund"`) is created to offset the plan limit portion * **Result**: User benefits (carryover and manual adjustments) are preserved, while business loss is avoided (plan limit offset by refund adjustment) **Why this approach?** * **Protects user benefits**: Carryover quota and admin manual adjustments are preserved * **Avoids business loss**: Plan limit portion is offset by refund adjustment (since the old plan receives a refund) * **Fair and transparent**: Clear logic with normal carryover + refund adjustment **Usage handling**: * Usage does **not** carry over to the new period (consistent with normal renewal behavior) * New period usage starts from 0 * Previous period's usage data is preserved in historical records and can be queried via history API * This is fair because the old plan was refunded and the user enjoys the new plan's quota **All aggregation types**: * ❌ **All aggregation types** (Sum, Count, CountUnique, Latest, Max): Usage does **not** carry over * ✅ New period usage starts from 0 for all aggregation types * ✅ Consistent with normal renewal behavior ### Downgrade Scenarios **Normal downgrade** (at period end): * ✅ Quota carryover works the same as normal upgrade * Unused quota is carried over to the new plan **Proration downgrade** (mid-period): * ✅ Quota carryover with refund adjustment (same as proration upgrade) * ❌ Usage does not carry over (starts from 0, consistent with normal renewal) ### One-Time Addon Behavior **What are One-Time Addons?** * One-time addons are purchased separately and have their own billing period * They provide additional quota for a specific metric **Normal upgrade with one-time addon**: ``` Period 1 - Plan A + One-Time Addon ├─ Plan A Limit: 1000 credits ├─ One-Time Addon: +500 credits ├─ Total: 1500 credits ├─ Used: 800 credits └─ Remaining: 700 credits ↓ Normal Upgrade to Plan B Period 2 - Plan B ├─ Plan B Limit: 2000 credits ├─ Carried Over: +700 credits (includes addon's remaining quota) └─ Total: 2700 credits ``` **Proration upgrade with one-time addon**: ``` Period 1 - Plan A + One-Time Addon ├─ Plan A Limit: 1000 credits ├─ One-Time Addon: +500 credits ├─ Total: 1500 credits ├─ Used: 800 credits └─ Remaining: 700 credits ↓ Proration Upgrade to Plan B (mid-period) Period 1 (remaining) - Plan B ├─ Plan B Limit: 2000 credits (prorated) ├─ Carried Over: +700 credits (normal carryover: 1500 - 800) ├─ Refund Adjustment: -1000 credits (offsets Plan A's plan limit) ├─ Total: 2000 + 700 - 1000 = 1700 credits └─ Usage: 0 credits (starts from 0) ⚠️ Note: One-time addon's remaining quota is included in carryover, but plan limit portion is offset by refund adjustment ``` **Important notes**: * One-time addons are attached to the purchase period * In normal upgrades, addon quota is preserved through carryover * In proration upgrades, all remaining quota (including addon quota) is carried over normally, but plan limit portion is offset by refund adjustment *** ## Best Practices ### For Business Owners 1. **Choose the Right Type** * Use Limit Recurring for prepaid credits * Use Limit Metered for monthly resets 2. **Set Appropriate Limits** * Consider how quota will accumulate over time * Plan for carryover amounts in your pricing model 3. **Monitor Usage Patterns** * Track how much quota carries over * Adjust base quotas if needed ### For Developers 1. **Check Quota Before Operations** * Always verify quota availability before processing * Handle limit-exceeded errors gracefully 2. **Handle Carryover Correctly** * System automatically handles carryover * No manual intervention needed 3. **Implement Proper Error Handling** * Show clear messages when quota is exhausted * Provide quota breakdown information to users *** ## Frequently Asked Questions ### Q: What happens if I don't use any quota in a month? **A**: Your full base quota (e.g., 1000 credits) will carry over to the next month. You'll start the next period with your base quota plus all unused quota. ### Q: Can quota accumulate indefinitely? **A**: Yes, there's no upper limit by design. If your business needs a cap, it would require additional configuration. ### Q: What happens when I change plans? **A**: The behavior depends on the type of plan change: **Normal upgrade/downgrade** (at period end): * ✅ Your carryover quota is preserved * ✅ You'll receive the new plan's base quota * ✅ Total = New base quota + Existing carryover * ✅ All quota sources (plan limit, carryover, manual adjustments) are carried over **Proration upgrade/downgrade** (mid-period): * ✅ **Quota carryover with refund adjustment**: Unused quota is normally carried over, but a refund adjustment offsets the plan limit portion (to avoid business loss since the old plan receives a refund) * ❌ **Usage does not carry over**: Usage data does not carry over to the new period (usage starts from 0, consistent with normal renewal) * ✅ You'll receive the new plan's base quota for the remaining period * ✅ Manual adjustments are carried over (protected user benefit) **If the new plan doesn't include the metric**: * The metric becomes unavailable * Historical quota is preserved but not usable For detailed examples, see the [Plan Upgrade and Downgrade Scenarios](#plan-upgrade-and-downgrade-scenarios) section above. ### Q: Can I request a quota adjustment? **A**: Yes, contact customer support if you believe you're entitled to a quota adjustment (e.g., service issues, billing errors). ### Q: How do I see my quota breakdown? **A**: View it in your user dashboard or through the API. The breakdown shows base plan, carryover, and manual adjustments separately. ### Q: What's the difference between Limit Metered and Limit Recurring? **A**: * **Limit Metered**: Quota resets completely each cycle (unused quota is lost) * **Limit Recurring**: Unused quota carries over to the next cycle (unused quota is preserved) *** ## Related Topics * [What is Billable Metric?](./what-is-billable-metric) * [Work with Limited-Type Metric](./limited-metric) * [Work with Charged-Type Metric](./charged-metric) * [Viewing User Usage Billing](./viewing-user-usage-billing) # Work with Limited-Type Metric (Limit Metered) Source: https://docs.unibee.dev/documentation/billable-metric/limited-metric Ideal for fixed-price plans, this metric type ensures that customers do not incur unexpected charges. When the predefined usage limit is reached, the system automatically rejects any further requests, keeping usage within budget. # Work with Limited-Type Metric (Limit Metered) The **Limit Metered** metric type is used to track user usage and prevent overconsumption. This metric type provides a **hard reset** each billing cycle, meaning unused quota is lost when the period ends. ## Key Characteristics * ✅ **Hard Reset**: Usage resets completely at the start of each billing cycle * ✅ **No Carryover**: Unused quota is lost at the end of each period * ✅ **Automatic Rejection**: System rejects requests when limit is reached * ✅ **Predictable Budgets**: Customers stay within their plan limits ## When to Use Limit Metered Perfect for: * Monthly allowances that should reset completely * Time-sensitive quotas (e.g., "1000 API calls per month") * Features where unused quota doesn't have value * Scenarios requiring a fresh start each billing cycle **Example**: "1000 API calls per month" - unused calls don't carry over *** ## Limit Metered vs Limit Recurring | Aspect | Limit Metered | Limit Recurring | | ------------------ | ---------------------- | --------------------------- | | **Reset Behavior** | Hard reset (complete) | Soft reset (with carryover) | | **Quota Loss** | Unused quota is lost | Unused quota is preserved | | **Use Case** | Monthly fresh starts | Prepaid credits | | **Example** | "1000 API calls/month" | "1000 SMS credits/month" | > 💡 **Need quota carryover?** See [Limit Recurring Metric](./limit-recurring-metric) for metrics that preserve unused quota. *** The metric system integrates with the UniBee API, which provides event-based statistics. You can report usage data by sending events to the [Event API](/api-reference/metric-event/new-merchant-metric-event). The metric counting for each product, you may need specified for the `productId` at Event API, default product will used if not specified Aggregation Type of Count metric event, it increases 1 usage number ```shellscript theme={null} curl --location --request POST "$UniBee_API_Host/merchant/merchant_metric/merchant_metric_event" \ --header "Authorization: Bearer $YOUR_API_KEY" \ --header 'Content-Type: application/json' \ --data-raw '{ "metricCode": "folder_count_limit", // code needs to be configured in advance in the UniBee portal "externalUserId": "$YOUR_USER_ID", "externalEventId": "string", // string, **unique**, e.m. [folderId] "metricProperties": {} }' ``` same externalEventId , no double counting Aggregation Type of Latest metric event, it Inspect 5, event of Latest type will not be add up ```shellscript theme={null} curl --location --request POST "$UniBee_API_Host/merchant/merchant_metric/merchant_metric_event" \ --header "Authorization: Bearer $YOUR_API_KEY" \ --header 'Content-Type: application/json' \ --data-raw '{ "metricCode": "active_profile_limit", // code needs to be configured in advance in the UniBee portal "externalUserId": "$YOUR_USER_ID", "externalEventId": "string", // string, **unique**, e.m. [folderId] "metricProperties": { "active_profile": 5 } }' ``` if this metricCode is Aggregation Type of Sum, 5 will be add up to the current value Normally, if the user has a subscription, the event interface returns the current value (based on the aggregation type) and the limit value for the user ```json theme={null} { "code": 0, "message": "", "data": { "merchantMetricEvent": { "id": 15685, "merchantId": 15621, "metricCode": "active_profile_limit", "externalEventId": "req20240223yuUd7wHU7k8Cz2Fs", "createTime": 1708667871, "subscriptionIds": "sub202402236DygwtxKvLE1zN2", "subscriptionPeriodStart": 1708658304, "subscriptionPeriodEnd": 1708744704, "metricLimit": 5, "used": 2 } }, "redirect": "", "requestId": "req20240223DYIVhsEzTXykZEE" } ``` When the user reaches the upper limit value set-up at Plan definision page, the event interface will return an error message (such as "reject")to inform Multilogin that the usage has reached the upper limit. ```json theme={null} { "code": 51, "message": "metric limit reached, current used: 10, limit: 10", "data": {}, "redirect": "", "requestId": "req20240223rmNJQOnggAuYpPd" } ``` ### Limit Boundary Behavior The system uses a **boundary-inclusive** check: when the usage plus the new event value **equals** the limit, the event is **allowed**. When it **exceeds** the limit, the event is **rejected**. **Examples**: * Limit = 100, Current Used = 90, Event Value = 10 → ✅ **Allowed** (90 + 10 = 100 ≤ 100) * Limit = 100, Current Used = 90, Event Value = 11 → ❌ **Rejected** (90 + 11 = 101 > 100) * Limit = 100, Current Used = 100, Event Value = 0 → ✅ **Allowed** (100 + 0 = 100 ≤ 100) * Limit = 100, Current Used = 100, Event Value = 1 → ❌ **Rejected** (100 + 1 = 101 > 100) *** ## Plan Limit Deletion Behavior ### Important: Plan Limit Must Be Configured **Limit Metered** metrics require a Plan Limit to be configured. If the Plan Limit is deleted or not configured, **all events will be rejected**, even if quota adjustments exist. **Behavior when Plan Limit is deleted**: 1. **Without Quota Adjustments**: * All events are rejected * Error message: `"metric limit reached, current used: X, limit: 0"` * `limit: 0` indicates that no Plan Limit is configured 2. **With Quota Adjustments**: * Quota adjustments **do not take effect** when Plan Limit is deleted * All events are rejected * Error message: `"metric limit reached, current used: X, limit: 0"` **Why this behavior?** * Limit types (Limit Metered, Limit Recurring) require a limit binding to function correctly * Without a Plan Limit, the system cannot determine the usage boundary * This prevents unlimited event creation that could cause unexpected behavior **To resolve**: * Ensure the Plan Limit is properly configured in the plan definition * If you need to temporarily disable the metric, consider archiving the plan or removing the metric from the plan instead of deleting the Plan Limit *** All the metric value will be reset to 0 when the user's subscription enters into the new billing cycle. **Important**: With Limit Metered, any unused quota is **lost** when the billing cycle ends. For example: * Month 1: Plan includes 1000 units, user uses 800 * Month 2: Plan resets to 1000 units (the 200 unused units from Month 1 are lost) If you need unused quota to carry over, use [Limit Recurring](./limit-recurring-metric) instead. Event also can be revoked in the same subscription period by API UniBee API, and relative usage will be revoked as well. # Setting Billable Metric Pricing Source: https://docs.unibee.dev/documentation/billable-metric/setting-billable-metric-pricing # Setting Billable Metric Pricing in UniBee ## 1. Overview After you’ve created your **Billable Metrics** (e.g., API Requests, Token Usage, Storage GB, etc.) in the **Billable Metric** module,\ the next step is to **link those metrics to your Product Plans** and define specific pricing rules.\ This completes your **Usage-based Billable** configuration. All pricing configurations are done under\ **Plan → Advanced Setup**, where you can combine fixed, recurring, and usage-based pricing models. *** ## 2. Navigation To configure pricing for metrics: 1. Open the sidebar menu:\ **Product → Product and Plan** 2. Select the plan you want to configure (e.g., *Main Monthly Plan*). 3. Click the **Advanced Setup** tab at the top of the page. *** ## 3. Advanced Setup Overview The **Advanced Setup** page contains several key sections: | Section | Description | | ----------------------------------------- | --------------------------------------------------------------- | | **Add-ons** | Add recurring or one-time add-ons to your plan. | | **Trial** | Configure free or paid trial periods. | | **Usage-based Billable (Charge Metered)** | Connect your created Billable Metrics and define their pricing. | | **Custom Data (JSON)** | Developer field for advanced custom pricing logic. | *** ## 4. Linking Billable Metrics to a Plan ### Step 1. Go to Usage-based Billable Scroll down to the **Usage-based Billable** section inside the Advanced Setup page.\ This is where you will connect your Billable Metrics using the **Charge Metered** block. *** ### Step 2. Select a Billable Metric From the **Name** dropdown, select one of your existing Billable Metrics, such as: * API Requests * Storage GB * Worker Duration These metrics are pulled from your previously created records in\ **Product → Billable Metric**. *** ### Step 3. Configure Pricing Rules Once you select a metric, you can define its pricing details: | Field | Description | Example | | ---------------- | ------------------------------------------------------------ | ------------------- | | **Pricing Type** | Choose *Standard Pricing* (Tiered pricing to be added soon). | Standard | | **Price** | Define the unit cost per usage. | \$2 per API request | | **Start Value** | The initial thres | | # Viewing User Usage Billing Source: https://docs.unibee.dev/documentation/billable-metric/viewing-user-usage-billing \#Viewing User Usage Billing in UniBee ## 1. Overview After you’ve configured **Billing Metrics** and linked them to your **Product Plans**, UniBee automatically tracks and displays each user’s usage-based charges.\ There are two main areas where admins can monitor this data: 1. **User Detail → Metering Usage tab** – View live usage data per user. 2. **Invoices → Invoice Detail view** – View billing details and total charges, including usage-based items. This guide explains how to check and verify these records step by step. *** ## 2. Viewing Usage Data per User ### Step 1. Navigate to User List From the left navigation panel, go to: **Customers → User List** This page lists all your customer accounts, including their **User ID**, **Email**, **Subscription Plan**, and **Status**. *** ### Step 2. Open the User Detail Page Click the **edit (pencil)** icon next to a user’s row to open the detailed view.\ This page displays key user information such as: * **User ID / External ID** * **Email and Country** * **Default Payment Method** * **Account / Subscription / Metering Usage Tabs** *** ### Step 3. Check Metering Usage Tab Select the **Metering Usage** tab to view usage metrics and consumption data.\ This section is divided into two parts: | Section | Description | | ------------------------- | ---------------------------------------------------------------------- | | **Limit Metered Usage** | Displays metrics that have consumption limits (e.g., capped features). | | **Charged Metered Usage** | Displays metrics billed on actual usage (e.g., API Requests, Tokens). | If there’s no recorded usage yet, the table will display “No data.” *** ### Step 4. Example: Viewing Billed Usage When usage is recorded for a user, the **Charged Metered Usage** table displays details such as: | Field | Description | Example | | ---------------------- | --------------------------------------------- | ------------ | | **Name** | Billing Metric name | API Requests | | **Is Recurring** | Whether the charge repeats each billing cycle | No | | **Aggregate Type** | Aggregation type used (e.g., count, sum) | count | | **Pricing Type** | Pricing model (e.g., Standard Pricing) | Standard | | **Price(Start Value)** | Price and starting threshold | \$2 (1) | | **Consumed** | Units of usage consumed | 5 | | **Cost** | Total calculated charge | \$8 | *** ## 3. Viewing Usage Billing in Invoices ### Step 1. Navigate to Invoice List Go to the left menu:\ **Customers → Invoices** The **Invoices** page lists all generated invoices, including their status, payment gateway, and total amount. *** ### Step 2. Open Invoice Detail Click on an **Invoice ID** to open its **Invoice Detail** popup.\ This view shows the breakdown of all billed items — both fixed recurring charges and usage-based charges. You’ll see the following sections: | Field | Description | | ----------------------------- | ------------------------------------------------ | | **Invoice Title** | The billing event type (e.g., SubscriptionCycle) | | **Item Description** | Line items for base plan + usage | | **Amount / Quantity / Total** | Unit price, count, and total per item | | **VAT / Tax** | Automatically applied tax if configured | | **Order Total** | Final amount after credits and discounts | *** ### Example Breakdown In the Invoice Detail view: | Item | Quantity | Unit Price | Total | | -------------------- | -------- | ---------- | ----------- | | Golden Monthly Plan | 1 | \$12.99 | \$12.99 | | API Requests (usage) | 2 | \$2.00 | \$4.00 | | **Subtotal** | | | **\$16.99** | | VAT (5%) | | | **\$0.85** | | **Order Total** | | | **\$17.84** | This confirms the **usage-based billing charges** are successfully captured and reflected in the user’s invoice. *** ## 4. Summary | Action | Where to View | Purpose | | ------------------------- | ---------------------------------- | ---------------------------------------------------------- | | **Check live usage data** | *User Detail → Metering Usage tab* | See user’s real-time consumption by metric | | **Verify billed usage** | *Invoice → Invoice Detail* | Confirm how usage translates into actual charges | | **Cross-check totals** | *Invoice Total Section* | Ensure accuracy between recorded metrics and invoice total | *** ## 🏁 Conclusion By reviewing data under **Metering Usage** and **Invoice Detail**,\ you can easily trace how each user’s consumption contributes to their billing cycle. This provides full transparency across: * **Usage tracking** (API Requests, Tokens, etc.) * **Automated billing** (based on recorded usage) * **Invoice validation** (displaying detailed usage costs) *** # What is billable metric Source: https://docs.unibee.dev/documentation/billable-metric/what-is-billable-metric UniBee Billable Metrics is an innovative billing solution designed to cater to various business needs, providing flexible and precise usage tracking and billing methods. Whether your business operates on fixed-price plans or dynamic usage-based pricing, UniBee Billable Metrics can meet your requirements. ## Core Features and Benefits ### Diverse Billable Metric Types: UniBee supports **four metric types** to accommodate different business models and usage patterns. #### Quick Comparison Table | Metric Type | Reset Behavior | Quota Carryover | Billing Model | Best For | | --------------------- | ---------------------- | --------------- | ------------------- | ---------------------------------------- | | **Limit Metered** | Hard reset each cycle | ❌ No | Fixed-price plans | Monthly allowances that reset completely | | **Limit Recurring** ⭐ | Soft reset + carryover | ✅ Yes | Fixed-price plans | Prepaid credits that accumulate | | **Charge Metered** | Resets each cycle | N/A | Usage-based billing | Pay-per-use services | | **Charge Recurring** | Never resets | N/A | Usage-based billing | Cumulative usage billing | *** #### Detailed Type Descriptions #### 1. Limit Metered **Purpose**: Ideal for fixed-price plans with usage caps. Prevents customers from incurring unexpected charges. **Behavior**: * Usage resets to zero at the start of each billing cycle (hard reset) * When the predefined limit is reached, the system automatically rejects further requests * Unused quota is lost at the end of each cycle **Example Use Cases**: * Monthly API call limit (e.g., "1000 API calls per month") * Monthly storage quota that resets completely * Feature access limits that don't accumulate **Example Scenario**: ``` Month 1: Plan includes 1000 API calls - User makes 800 calls - 200 calls unused → Lost when cycle ends Month 2: Plan resets to 1000 calls (fresh start) ``` *** #### 2. Limit Recurring ⭐ **Purpose**: Ideal for prepaid credits or allowances where unused quota has value and should be preserved. **Behavior**: * Soft reset at the start of each billing cycle (carries over unused quota) * Unused quota automatically carries forward to the next period * Supports manual quota adjustments by administrators **Example Use Cases**: * Prepaid SMS credits (unused credits carry forward) * Prepaid call minutes * Monthly data allowances that accumulate **Example Scenario**: ``` Month 1: Plan includes 1000 SMS credits - User sends 700 SMS - 300 credits unused → Carries forward automatically Month 2: Plan includes 1000 SMS credits - User starts with 1300 credits (1000 base + 300 carryover) - Credits accumulate if not fully used ``` **Key Features**: * Automatic carryover of unused quota * Manual quota adjustments for compensation or corrections * Complete audit trail of quota sources *** #### 3. Charge Metered **Purpose**: Suitable for usage-based billing where you charge customers based on actual consumption. **Behavior**: * Usage resets to zero at the start of each billing period * Charges are calculated based on usage during the period * Additional amounts are added to the invoice at period end **Example Use Cases**: * Pay-per-use API calls * Usage-based storage charges * Per-transaction fees **Example Scenario**: ``` Month 1: - User makes 500 API calls - Each call costs $0.10 - Additional charge: $50 added to invoice Month 2: Usage resets, new billing cycle starts ``` *** #### 4. Charge Recurring **Purpose**: For usage-based plans where usage accumulates continuously across billing periods. **Behavior**: * Usage does NOT reset at the beginning of each period * Continuous accumulation of usage over time * Charges based on total accumulated usage **Example Use Cases**: * Total data usage billing * Lifetime transaction count * Cumulative storage usage **Example Scenario**: ``` Month 1: User uses 100 GB Month 2: User uses 50 GB (total: 150 GB) Month 3: User uses 75 GB (total: 225 GB) - Billing based on cumulative total ``` ### Flexible Metric Aggregation Types: * Count: Counts the number of events received, ideal for simple usage tracking such as API calls or transactions. * Count Unique: Determines the number of unique values associated with a custom property, suitable for tracking unique users or unique actions. * Latest: Only considers the value of the last event received, useful for scenarios where only the latest data matters, such as the latest temperature reading in an IoT application. * Max: Considers the highest value received, useful for setting usage limits to ensure no single value exceeds a predetermined threshold. * Sum: Calculates the total value of all events received during the period, ideal for metrics like total data usage or total sales within a billing cycle. ### Advanced Data Analysis and Reporting: * UniBee Billable Metrics not only offers various billing types and aggregation methods but also comes equipped with powerful data analysis and reporting tools. With detailed usage reports and analytics, you can gain deep insights into customer usage patterns, optimizing resource allocation and pricing strategies. ### Seamless Integration and Expansion: * Designed with modern businesses in mind, UniBee Billable Metrics provides extensive API interfaces and integration options. Whether integrating with existing CRM systems, ERP systems, or other third-party tools, it can be done effortlessly. ### Customer-Friendly Billing Management: * UniBee Billable Metrics not only provides flexible billing solutions for businesses but also offers transparent usage and billing information for customers. With a user-friendly interface, customers can easily view their usage and billing details, enhancing user experience and satisfaction. # Do you need to use billable metric? UniBee Billable Metrics offers: * Flexibility: Whether for fixed-price plans or dynamic usage-based pricing, UniBee meets your needs. * Accuracy: Various aggregation methods ensure billing accuracy and transparency. * Insight: Powerful data analysis tools help you understand customer behavior and optimize business strategies. * Ease of Use: Seamless integration and a user-friendly interface make usage and billing management easy for you and your customers. Choose UniBee Billable Metrics and experience unparalleled billing flexibility and accuracy, taking your business to the next level, having a flexible and precise billing system. # How to set up billable metric in UniBee? These metrics data can be create and link to plan in admin portal Setup Billable Metric ## Metric Aggregation Type * Count: Counts the number of events received for the metric * Count Unique: Determines the number of unique values associated with the custom property * Latest: Only takes into account the value of the last event received * Max: Takes into account the value of the highest event received * Sum: Adds up all the values received for the defined property # Export data with an API key Source: https://docs.unibee.dev/documentation/business-integration/api-key-export-tasks Create asynchronous export tasks, poll their status, and download CSV or XLSX files with a UniBee merchant API key. ## Overview Use the merchant Task APIs when an export may contain more records than a normal list response. UniBee creates the export asynchronously, processes all result pages internally, and exposes the finished file through an authenticated download URL. The workflow uses these endpoints: | Step | Method and endpoint | Purpose | | ---- | ---------------------------------------- | ------------------------------------------------------------ | | 1 | `POST /merchant/task/export_column_list` | Optional. Discover the columns available for an export type. | | 2 | `POST /merchant/task/new_export` | Create an asynchronous export task. | | 3 | `GET` or `POST /merchant/task/list` | Poll the task until it succeeds or fails. | | 4 | `GET /export/{taskId}` | Download the completed file from the task's `downloadUrl`. | All four requests must use the same merchant API key. ## Authorization and hosts Send the merchant API key as a Bearer token: ```http theme={null} Authorization: Bearer YOUR_API_KEY ``` | Environment | Base URL | | ----------- | -------------------------------- | | Production | `https://api.unibee.dev` | | Sandbox | `https://api-sandbox.unibee.top` | API-key export tasks are isolated from Admin Portal member tasks. An API key can list and download only API-created tasks for its merchant; it cannot access a member's export tasks or another merchant's data. ## Complete export workflow ### 1. Get available columns (optional) Call this endpoint when you want to let users choose columns or need the exact accepted values for `exportColumns`: ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/task/export_column_list" \ -H "Authorization: Bearer $UNIBEE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "task": "SubscriptionExport" }' ``` The response includes: * `columns`: values accepted by `exportColumns`. * `columnHeaders`: default display header for each column. * `columnComments`: additional column descriptions when available. * `groupColumns`: columns grouped by subject. Omit `exportColumns` when creating a task to export every available column. ### 2. Create an export task ```bash theme={null} curl -X POST "https://api.unibee.dev/merchant/task/new_export" \ -H "Authorization: Bearer $UNIBEE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "task": "SubscriptionExport", "payload": { "status": [2], "currency": "USD", "createTimeStart": 1767225600, "createTimeEnd": 1769904000, "timeZone": "Asia/Shanghai" }, "exportColumns": [ "subscriptionId", "email", "status", "planName", "createTime" ], "format": "csv" }' ``` | Field | Type | Required | Description | | --------------- | --------- | -------- | ------------------------------------------------------------------------------------ | | `task` | string | Yes | Export type. Use one of the nine public task names listed below. | | `payload` | object | No | Filters for the selected export. Use `{}` or omit it to export all matching records. | | `exportColumns` | string\[] | No | Columns returned by `export_column_list`. Omit to export all columns. | | `format` | string | No | `xlsx` or `csv`. Defaults to `xlsx`. | Do not put `page` or `count` in `payload`. The export service reads all pages internally. `new_export` confirms that the task was accepted but does not return a task ID. Poll `task/list` and identify the newly created item by its `taskName`, `payload`, and `createTime`. If the same API key creates identical exports concurrently, serialize those requests or compare the task IDs returned before and after creation. ### 3. Poll task status ```bash theme={null} curl -X GET "https://api.unibee.dev/merchant/task/list?page=0&count=20" \ -H "Authorization: Bearer $UNIBEE_API_KEY" ``` Each item in `data.downloads` contains the task details. | Field | Description | | --------------- | ---------------------------------------------------------- | | `id` | Task ID. | | `taskName` | Export type, such as `SubscriptionExport`. | | `payload` | Stored export payload as a JSON string. | | `status` | `0` pending, `1` processing, `2` success, or `3` failure. | | `downloadUrl` | Authenticated download URL. Use only when `status` is `2`. | | `failureReason` | Failure detail when `status` is `3`. | | `successCount` | Number of exported records processed so far. | | `format` | `xlsx` or `csv`. | | `createTime` | Task creation time as Unix seconds. | Poll with a reasonable interval, such as 2–5 seconds, and stop when the task reaches status `2` or `3`. Use exponential backoff for long-running exports. ### 4. Download the file The `downloadUrl` is protected. Send the same API key in the download request: ```bash theme={null} curl -L "https://api.unibee.dev/export/12345" \ -H "Authorization: Bearer $UNIBEE_API_KEY" \ --output unibee-export.csv ``` Do not treat `downloadUrl` as a public or presigned URL. A request without the authorization header is denied. ## How `payload` works `payload` is a JSON object, not a JSON-encoded string. Its fields correspond to filters consumed by the selected export task. These export-only fields are available for all task types: | Field | Type | Description | | ---------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `timeZone` | string | IANA time zone used to display timestamps in the exported file, for example `UTC`, `America/New_York`, or `Asia/Shanghai`. Defaults to `UTC`. | | `legacyTimeZoneOffset` | boolean | Compatibility option. When `true`, subtracts the `timeZone` offset from timestamp filters before querying. New integrations should omit it or set it to `false`. | Timestamp filters are Unix timestamps in seconds. By default, UniBee uses them exactly as supplied; `timeZone` changes exported timestamp display and does not change the filter range. Amount filters such as `amountStart` and `amountEnd` use the currency's smallest unit, for example `1000` means USD 10.00. For filters using `planTagFilter`, pass: ```json theme={null} { "planTagFilter": { "tagIds": [101, 102], "mode": "any" } } ``` `mode` can be `any` or `all` and defaults to `any`. When `planIds` and `planTagFilter` are both present, they are combined with union/OR semantics. ## Available export tasks and filters Only the fields listed for each task below are consumed by that export implementation. Unknown payload fields are ignored. | Task name | Exported data | Related list endpoint | | -------------------- | ----------------------------------- | --------------------------------------- | | `SubscriptionExport` | Subscriptions | `/merchant/subscription/list` | | `InvoiceExport` | Invoices | `/merchant/invoice/list` | | `UserExport` | Users | `/merchant/user/list` | | `TransactionExport` | Payment and refund timeline records | `/merchant/payment/timeline/list` | | `DiscountExport` | Discount codes | `/merchant/discount/list` | | `UserDiscountExport` | Discount usage records | `/merchant/discount/user_discount_list` | | `PlanExport` | Plans | `/merchant/plan/list` | | `MetricEventExport` | Billable metric events | `/merchant/metric/event_list` | | `UserChurnExport` | Churn episodes | `/merchant/user_churn/list` | ### `SubscriptionExport` Exports subscriptions. Its filters correspond to `GET|POST /merchant/subscription/list`. | Filter | Type | Description | | ----------------- | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | | `userId` | integer | Exact UniBee user ID. | | `externalUserId` | string | Exact external user ID. | | `searchKey` | string | Search subscription ID or email. | | `email` | string | Filter by the subscription user's email. | | `status` | integer\[] | `1` pending, `2` active, `3` pending-inactive (deprecated), `4` cancelled, `5` expired, `6` suspended, `7` incomplete, `8` processing, `9` failed. | | `currency` | string | Currency code, for example `USD`. | | `planIds` | integer\[] | Include subscriptions using any listed plan ID. | | `planTagFilter` | object | Filter by plan tags using `tagIds` and `mode`. Combined with `planIds` using OR. | | `productIds` | integer\[] | Include subscriptions using any listed product ID. Ignored when `planIds` is supplied. | | `amountStart` | integer | Minimum subscription amount in the smallest currency unit. | | `amountEnd` | integer | Maximum subscription amount in the smallest currency unit. | | `sortField` | string | `gmt_create` or `gmt_modify`; default `gmt_modify`. | | `sortType` | string | `asc` or `desc`; default `desc`. | | `createTimeStart` | integer | Inclusive creation-time lower bound, Unix seconds. | | `createTimeEnd` | integer | Creation-time upper bound, Unix seconds. | Example—active USD subscriptions: ```json theme={null} { "status": [2], "currency": "USD" } ``` ### `InvoiceExport` Exports invoices. Its filters correspond to `GET|POST /merchant/invoice/list`. | Filter | Type | Description | | ----------------- | ---------- | ------------------------------------------------------------------------------------------------ | | `userId` | integer | Exact UniBee user ID. | | `gatewayIds` | integer\[] | Include invoices for any listed gateway ID. | | `planIds` | integer\[] | Include invoices containing any listed plan ID. | | `planTagFilter` | object | Filter by plan tags. Combined with `planIds` using OR. | | `hasDiscountCode` | boolean | `true` for invoices with a discount code; `false` for invoices without one. | | `discountCode` | string | Exact discount code, case-insensitive. | | `firstName` | string | Filter by invoice user first name. | | `lastName` | string | Filter by invoice user last name. | | `currency` | string | Currency code. | | `status` | integer\[] | `1` pending, `2` processing, `3` paid, `4` failed, `5` cancelled, `6` reversed. | | `searchKey` | string | Search invoice name, email, or product name. | | `deleteInclude` | boolean | Include deleted records. | | `type` | integer | `0` payment invoice or `1` refund invoice. | | `sendEmail` | string | Filter by the invoice email value. | | `sortField` | string | `invoice_id`, `gmt_create`, `gmt_modify`, `period_end`, or `total_amount`; default `gmt_modify`. | | `sortType` | string | `asc` or `desc`; default `desc`. | | `amountStart` | integer | Minimum invoice amount in the smallest currency unit. | | `amountEnd` | integer | Maximum invoice amount in the smallest currency unit. | | `createTimeStart` | integer | Creation-time lower bound, Unix seconds. | | `createTimeEnd` | integer | Creation-time upper bound, Unix seconds. | | `reportTimeStart` | integer | Report-time lower bound, Unix seconds. | | `reportTimeEnd` | integer | Report-time upper bound, Unix seconds. | Example—paid invoices created during January 2026: ```json theme={null} { "status": [3], "createTimeStart": 1767225600, "createTimeEnd": 1769904000 } ``` ### `UserExport` Exports users. Its filters correspond to `GET|POST /merchant/user/list`. | Filter | Type | Description | | ----------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `userId` | integer | Exact UniBee user ID. | | `externalUserId` | string | Exact external user ID. | | `email` | string | Filter by email. | | `firstName` | string | Filter by first name. | | `lastName` | string | Filter by last name. | | `searchKey` | string | Search first name, last name, email, phone, address, or external user ID. | | `subscriptionId` | string | Exact subscription ID. | | `status` | integer\[] | User status: `0` active or `2` suspended. | | `subStatus` | integer\[] | Subscription status: `1` pending, `2` active, `3` pending-inactive (deprecated), `4` cancelled, `5` expired, `6` suspended, `7` incomplete, `8` processing, `9` failed. | | `planIds` | integer\[] | Include users associated with any listed plan ID. | | `gatewayIds` | integer\[] | Include users associated with any listed gateway ID. | | `deleteInclude` | boolean | Include deleted users. | | `sortField` | string | `user_id`, `gmt_create`, `email`, `user_name`, `subscription_name`, `subscription_status`, `payment_method`, `recurring_amount`, or `billing_type`; default `gmt_create`. | | `sortType` | string | `asc` or `desc`; default `desc`. | | `createTimeStart` | integer | Creation-time lower bound, Unix seconds. | | `createTimeEnd` | integer | Creation-time upper bound, Unix seconds. | ### `TransactionExport` Exports payment and refund timeline records. Its filters correspond to `GET|POST /merchant/payment/timeline/list`. | Filter | Type | Description | | ----------------- | ---------- | ------------------------------------------------------------------------------------------------ | | `userId` | integer | Exact UniBee user ID. | | `searchKey` | string | Search subscription ID, invoice ID, payment ID, or user ID. | | `currency` | string | Currency code. | | `amountStart` | integer | Minimum transaction amount in the smallest currency unit. | | `amountEnd` | integer | Maximum transaction amount in the smallest currency unit. | | `status` | integer\[] | `0` pending, `1` success, `2` failure, `3` cancelled. | | `timelineTypes` | integer\[] | `0` payment or `1` refund. | | `gatewayIds` | integer\[] | Include transactions for any listed gateway ID. | | `planIds` | integer\[] | Include timelines whose invoice contains any listed plan ID. | | `planTagFilter` | object | Filter by invoice plan tags. Combined with `planIds` using OR. | | `hasDiscountCode` | boolean | Filter by whether the related invoice has a discount code. | | `discountCode` | string | Exact related-invoice discount code, case-insensitive. | | `sortField` | string | `invoice_id`, `gmt_create`, `gmt_modify`, `period_end`, or `total_amount`; default `gmt_modify`. | | `sortType` | string | `asc` or `desc`; default `desc`. | | `createTimeStart` | integer | Creation-time lower bound, Unix seconds. | | `createTimeEnd` | integer | Creation-time upper bound, Unix seconds. | ### `DiscountExport` Exports discount codes. Its filters correspond to `GET /merchant/discount/list`. | Filter | Type | Description | | ----------------- | ---------- | ---------------------------------------------------------------------- | | `discountType` | integer\[] | `1` percentage or `2` fixed amount. | | `billingType` | integer\[] | `1` one-time or `2` recurring. | | `status` | integer\[] | `1` editable, `2` active, `3` deactivated, `4` expired, `10` archived. | | `code` | string | Exact discount code. | | `searchKey` | string | Search discount code or name. | | `currency` | string | Currency code. | | `sortField` | string | `gmt_create` or `gmt_modify`; default `gmt_modify`. | | `sortType` | string | `asc` or `desc`; default `desc`. | | `createTimeStart` | integer | Creation-time lower bound, Unix seconds. | | `createTimeEnd` | integer | Creation-time upper bound, Unix seconds. | ### `UserDiscountExport` Exports usage records for one discount code. Its filters correspond to `GET /merchant/discount/user_discount_list`. | Filter | Type | Required | Description | | ----------------- | ---------- | -------- | ------------------------------------------------------------------------------------- | | `id` | integer | Yes | UniBee discount ID. The export returns no rows when this field is missing or invalid. | | `userIds` | integer\[] | No | Include records for any listed user ID. | | `email` | string | No | Filter by user email. | | `planIds` | integer\[] | No | Include records for any listed plan ID. | | `subscriptionIds` | string\[] | No | Include records for any listed subscription ID. | | `status` | integer\[] | No | `1` used or `2` rolled back. | | `childCode` | string | No | Fuzzy-search a child code; available when `id` is a batch-template ID. | | `sortField` | string | No | `gmt_create` or `gmt_modify`; default `gmt_modify`. | | `sortType` | string | No | `asc` or `desc`; default `desc`. | | `createTimeStart` | integer | No | Creation-time lower bound, Unix seconds. | | `createTimeEnd` | integer | No | Creation-time upper bound, Unix seconds. | Example: ```json theme={null} { "id": 1001, "status": [1] } ``` ### `PlanExport` Exports plans. Its filters correspond to `GET|POST /merchant/plan/list`. | Filter | Type | Description | | --------------- | ---------- | ---------------------------------------------------------------------------- | | `planIds` | integer\[] | Include any listed plan ID. | | `planTagFilter` | object | Filter by plan tags. Combined with `planIds` using OR. | | `productIds` | integer\[] | Include plans belonging to any listed product ID. | | `type` | integer\[] | `1` main plan, `2` recurring add-on, `3` one-time plan. | | `status` | integer\[] | `1` editing, `2` active, `3` inactive, `4` soft-archived, `5` hard-archived. | | `publishStatus` | integer | `1` unpublished or `2` published. | | `searchKey` | string | Search plan name or description. | | `currency` | string | Currency code. | | `sortField` | string | `plan_name`, `gmt_create`, or `gmt_modify`; default `gmt_create`. | | `sortType` | string | `asc` or `desc`; default `desc`. | ### `MetricEventExport` Exports billable metric events. Its filters correspond to `GET|POST /merchant/metric/event_list`. | Filter | Type | Description | | ----------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------- | | `userIds` | integer\[] | Include events for any listed user ID. | | `metricIds` | integer\[] | Include events for any listed metric ID. | | `subscriptionIds` | string\[] | Include events for any listed subscription ID. | | `invoiceId` | string | List events for the invoice period. When supplied, its subscription period overrides `createTimeStart` and `createTimeEnd`. | | `sortField` | string | `user_id` or `gmt_create`; default `gmt_create`. | | `sortType` | string | `asc` or `desc`; default `desc`. | | `createTimeStart` | integer | Creation-time lower bound, Unix seconds. | | `createTimeEnd` | integer | Creation-time upper bound, Unix seconds. | ### `UserChurnExport` Exports churn episodes. Its filters correspond to `GET|POST /merchant/user_churn/list`. | Filter | Type | Description | | ---------------- | ---------- | -------------------------------------------------------------------------------- | | `view` | string | `pending`, `current`, `reactivated`, or `all`; default `all`. | | `churnTimeStart` | integer | Inclusive churn-time lower bound, Unix seconds. | | `churnTimeEnd` | integer | Exclusive churn-time upper bound, Unix seconds; the range is `[start, end)`. | | `churnType` | string | `Cancelled` or `Expired`. | | `reasonCategory` | string | Normalized churn reason category. | | `productIds` | integer\[] | Include churn records for any listed product ID. | | `planIds` | integer\[] | Include churn records for any listed plan ID. | | `userId` | integer | Exact UniBee user ID. | | `email` | string | Filter by email. | | `externalUserId` | string | Filter by external user ID. | | `searchKey` | string | Search email, external user ID, subscription ID, or user ID. | | `countryCode` | string | Filter by country code. | | `currency` | string | Filter by currency code. | | `sortField` | string | `churn_time`, `confirm_time`, `reactivated_time`, or `id`; default `churn_time`. | | `sortType` | string | `asc` or `desc`; default `desc`. | ## Error handling | Condition | Behavior | | ----------------------------------- | -------------------------------------------------------------------------------------------- | | Missing or invalid API key | Merchant API endpoints return HTTP `401`. The download endpoint denies the request. | | Invalid `task` | `new_export` returns a validation error such as `Task not found`. | | Invalid `format` | The request fails unless the value is `xlsx` or `csv`. | | Task status `3` | Read `failureReason`; create a new task after correcting the request or after a retry delay. | | Download before status `2` | The download endpoint returns HTTP `400`. | | API key belongs to another merchant | The download endpoint returns `Not Your Task`. | For JSON API errors, check both the HTTP status and the response envelope's `code` and `message`. Log `requestId` when contacting UniBee support. # Make Billing API calls Source: https://docs.unibee.dev/documentation/business-integration/billing-api-call Integrate UniBee into your business by making direct API calls All API calls to the UniBee service require an API key included in the request header. You can find and configure the UniBee Base URL in the UniBee Admin Portal at Configuration->Integrations->UniBee Base URL. Use one of the following hosts as your `$UniBee_API_Host`: * Production API Host: [https://api.unibee.dev](https://api.unibee.dev) * Sandbox API Host: [https://api-sandbox.unibee.top](https://api-sandbox.unibee.top) ```shell theme={null} curl --location --request POST "$UniBee_API_Host/merchant/merchant_metric/merchant_metric_event" \ --header "Authorization: Bearer $UNIBEE_API_KEY" \ --header 'Content-Type: application/json' \ --data-raw '{ "metricCode": "folder_count_limit", // code needs to be configured in advance in the UniBee portal "externalUserId": "$YOUR_USER_ID", "externalEventId": "string", // string, __unique__, e.m. [folderId] "metricProperties": {} }' ``` You can go to UniBee Admin Portal (Configuration->Integrations->UniBee API Key) to create or regenerate the API key, the current key will still be valid within 1 hour after creating a new key. Go to our [API docs](/api-reference) for further detail. ### API object definitions | Resource | Definition | | ------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [Product API](/api-reference/product) | A good or service that your business sells. A service product can include one or more features. | | [Plan API](/api-reference/plan) | Defines the unit price, currency, and billing cycle for a product. | | [User API](/api-reference/user) | Represents a customer who purchases a subscription. Use the Customer object associated with a subscription to make and track recurring charges and to manage the products that they subscribe to. | | [Invoice API](/api-reference/invoice) | A statement of amounts a customer owes that tracks payment statuses from draft through paid or otherwise finalized. Subscriptions automatically generate invoices. | | [Payment API](/api-reference/payment) | A way to build dynamic payment flows. A PaymentIntent tracks the lifecycle of a customer checkout flow and triggers additional authentication steps when required by regulatory mandates, custom Radar fraud rules, or redirect-based payment methods. Invoices automatically create PaymentIntents. | | [Subscription API](/api-reference/subscription) | Represents a customer’s scheduled recurring purchase of a product. Use a subscription to collect payments and provide repeated delivery of or continuous access to a product. | # Change Subscription After Purchases (Hosted Mode) Source: https://docs.unibee.dev/documentation/business-integration/change-subscription-hosted-page-after-purchases UniBee Hosted Update Page can help you build the ability to change subscriptions on your website or application The UniBee Hosted Update Page is a secure, user-authenticated interface designed to increase conversions with minimal code that enables subscribers to manage and modify their active subscriptions, including plan changes, renewals, cancellations, and payment method updates. UniBee Hosted Update Page UniBee Hosted Update Page: Used for change subscriptions after the initial purchase * Requires user authentication * Available to all subscriber users * Supports renewal, upgrade, downgrade, and cancellation * Allows users to change payment methods * Displays current subscription details with update preview * Access Link: Generate link from [Session API](/api-reference/session/get-user-subscription-update-page-url-1) ```shell theme={null} curl --request POST \ --url $UniBee_API_Host/merchant/session/user_sub_update_url \ --header 'Authorization: Bearer $UNIBEE_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "cancelUrl": "", "email": "", "externalUserId": "", "planId": 123, "productId": 123, "returnUrl": "", "userId": 123, "vatCountryCode": "" }' ``` The hosted change subscription will not effect to existence subscriptions itself immediately, an `PendingUpdate` process will create and trace the change action before payment successful. After payment successful, relative [webhook events](/documentation/webhooks/webhook-events.mdx) will send * `subscription.pending_update.success` * `invoice.paid` * `subscription.updated` Next please refer below docs for status further detail. * [Subscription status definision](/documentation/subscription/status#status) * [Subscription auto-charge workflow](/documentation/subscription/subscription-auto-charge-workflow.mdx) * [Subscription status flow](/documentation/subscription/status#status-flow) # Checkout Purchases (Hosted Mode) Source: https://docs.unibee.dev/documentation/business-integration/checkout-purchases Checkout Purchase can help you build the ability to receive subscriptions on your website or application UniBee Checkout Page (UCP) provides you with a suite of optimized pre-built subscription features designed to increase conversions with no code. Simply direct your buyers to UniBee checkout page to easily and securely process first-subscription purchases. Checkout Page: Designed for first-time purchases * No user authentication required * Available to every active Plan * Access Link: copy link from Plan definision page and go to Checkout UniBee Checkout Page * Successful return: setup your successful return url at Product definision page UniBee Checkout Return Config1 Page UniBee Checkout Return Config2 Page A `Pending` subscription will be created and remain in that state for several days (`3` days by default) while waiting for the user to complete the purchase. Once the payment is successful, the subscription will transition to the `active` state. At that point, you can either receive a webhook event or retrieve the subscription details via the API. ## Work with Session API If you have obtained user information in advance (including Email) and want to pre-fill the `Email` field on the checkout page, as well as set specific `ReturnUrl` and `CancelUrl`, you can use the Session API. You need to: 1. Get a ClientSession from the Session API: [Checkout Session API](/api-reference/session/new-user-portal-session) 2. **Append the session** to the checkout link parameters: ``` https://cs.unibee.dev/hosted/checkout?planId=253&env=prod&session=${clientSession} ``` This approach allows you to pre-authenticate users and provide a seamless checkout experience. To integrate properly: * You must set up a webhook endpoint and subscribe to [webhook events](/documentation/webhooks/webhook-events.mdx) such as `subscription.activated` or `invoice.paid`. * Alternatively, your system can call the OpenAPI to fetch the user’s [user subscription detail](/api-reference/subscription/user-subscription-detail) directly. Next please refer below docs for status further detail. * [Subscription status definision](/documentation/subscription/status#status) * [Subscription auto-charge workflow](/documentation/subscription/subscription-auto-charge-workflow.mdx) * [Subscription status flow](/documentation/subscription/status#status-flow) # Collect taxes Source: https://docs.unibee.dev/documentation/business-integration/collect-tax Learn how to collect taxes with UniBee using VAT gateways and automatic tax calculation # Collect Taxes with UniBee UniBee provides comprehensive tax collection capabilities for both international (VAT) and US (Sales Tax) customers. The system automatically calculates taxes based on customer location, validates VAT numbers, and ensures compliance with tax regulations. ## Overview UniBee supports two main tax systems: * **VAT (Value Added Tax)**: For EU and international customers * **US Sales Tax**: For US customers via TaxJar integration Taxes are automatically calculated during checkout and applied to all invoices, ensuring your business stays compliant with tax regulations worldwide. *** ## VAT Tax System (EU/International) ### Available VAT Gateways UniBee supports multiple VAT gateway options to suit different business needs: #### 1. Default Gateway (Built-in) **Best for**: Small businesses or businesses that need basic VAT calculation **Features**: * ✅ Built-in VAT rate database * ✅ No API key required * ✅ Free to use * ✅ Supports most EU and international countries * ✅ Based on official EU tax rates **Setup**: Automatically available - no configuration needed #### 2. VATSense Gateway **Best for**: Businesses that need professional VAT validation and real-time rate updates **Features**: * ✅ Real-time VAT number validation * ✅ Automatic weekly rate updates * ✅ EORI number validation support * ✅ Professional VAT service provider **Setup**: Requires VATSense API key #### 3. VATStack Gateway **Best for**: Alternative professional VAT service **Features**: * ✅ VAT number validation * ✅ Country tax rate queries * ✅ Webhook support for async validation **Setup**: Requires VATStack API key #### 4. Github VIES Gateway **Best for**: EU-only businesses looking for a free VAT validation solution **Features**: * ✅ Free service * ✅ EU VAT number validation via VIES system * ✅ Format and entity validation **Setup**: No API key required (free service) ### Setting Up a VAT Gateway 1. Go to **Settings** page in UniBee Admin Portal 2. Navigate to **Configuration** → **Integrates** tab 3. Select your preferred VAT gateway 4. Enter API key (if required) 5. Save the configuration > 💡 **Which gateway should I choose?** > > * Start with **Default Gateway** if you need basic VAT calculation > * Use **VATSense** or **VATStack** if you need VAT number validation > * Choose **Github VIES** for free EU-only VAT validation ### How VAT Calculation Works UniBee automatically calculates VAT based on: 1. **Customer's country**: Tax rates vary by country 2. **VAT number**: Valid VAT numbers result in 0% tax (business-to-business) 3. **Product type**: Some products may have different tax rates 4. **Payment gateway rules**: You can configure custom rates per gateway **Tax Calculation Flow**: ``` Customer makes purchase ↓ System checks customer's country ↓ Retrieves applicable tax rate ↓ Checks if customer has valid VAT number ├─ Yes → 0% tax (B2B transaction) └─ No → Apply standard tax rate ↓ Tax added to invoice ``` ### VAT Number Validation When customers provide a VAT number, UniBee automatically validates it: * **Real-time validation**: VAT numbers are checked against official databases * **Automatic exemption**: Valid VAT numbers result in 0% tax * **Validation history**: All validations are recorded for your records **How it works**: 1. Customer enters VAT number during checkout 2. UniBee validates the number format 3. System checks validation history (cached results) 4. If not cached, calls VAT gateway for real-time validation 5. Valid VAT number = 0% tax applied automatically > ⚠️ **Important**: VAT validation only confirms the number is valid. You may still need to verify the customer's name and address matches the VAT registration after purchase. ### Changing Customer Tax for Recurring Payments When you change a customer's country, the tax rate will automatically update: 1. Go to **Customers** → **User List** 2. Select the customer 3. Edit their country information 4. The next invoice will use the new tax rate (if changed before the next billing cycle) **Note**: For recurring subscriptions, the tax rate is retrieved from the customer's data and calculated based on the current tax rate at invoice generation time. *** ## Custom Tax Rates via API You can also manage taxes within your own system and pass custom tax rates via UniBee API. Custom rates take precedence over gateway-provided rates. ### APIs Supporting Custom Tax Rates * [Subscription Create Preview](/api-reference/subscription/create-subscription-preview) * [Subscription Create Submit](/api-reference/subscription/create-subscription) * [Subscription Update Preview](/api-reference/subscription-update/update-subscription-preview) * [Subscription Update Submit](/api-reference/subscription-update/update-subscription) * [Subscription Renew](/api-reference/subscription-update/renew-subscription) ### Fields to Use When calling these APIs, you can specify: * `taxPercentage`: Custom tax rate (in basis points, e.g., 1900 = 19%) * `vatNumber`: Customer's VAT number * `vatCountryCode`: Customer's country code **Example**: ```json theme={null} { "taxPercentage": 2000, // 20% tax "vatNumber": "GB123456789", "vatCountryCode": "GB" } ``` > 💡 **Priority**: Custom tax rates specified via API take precedence over rates provided by VAT gateways. *** ## Tax on Refunds When processing refunds, UniBee automatically: * ✅ Uses the original invoice's tax rate * ✅ Calculates refund tax accurately * ✅ Maintains tax compliance for refunds The system ensures that refund taxes match the original purchase taxes for proper accounting. *** ## Best Practices ### For VAT Setup 1. **Choose the right gateway**: * Start with Default Gateway for basic needs * Upgrade to VATSense/VATStack if you need validation * Use Github VIES for free EU-only validation 2. **Enable VAT number validation**: * Allows B2B customers to provide VAT numbers * Automatically exempts valid VAT numbers from tax 3. **Keep rates updated**: * Default Gateway uses built-in rates * VATSense/VATStack update weekly automatically * Verify rates periodically for accuracy ### For Tax Compliance 1. **Verify VAT numbers**: Even though UniBee validates VAT numbers, verify customer details match registration 2. **Keep records**: All tax calculations and VAT validations are logged for audit purposes 3. **Monitor changes**: Tax rates can change - ensure your gateway stays updated *** ## Related Topics * [US VAT & TaxJar Setup](./us-vat-and-taxjar) - For US sales tax collection * [Invoice Computation](../invoices/invoice-computation) - Understanding tax in invoices # Custom Checkout Page Source: https://docs.unibee.dev/documentation/business-integration/custom-checkout-page How to create and manage custom checkout pages in UniBee ## Overview UniBee supports fully customizable checkout pages, enabling merchants to tailor the visual style, form structure, and display logic of the checkout flow. This is especially useful for scenarios requiring branded user journeys, region-specific compliance (e.g. different tax logic), or embedding within existing websites or apps. This guide covers how to manage checkout templates, assign them to product plans, and configure layout and functional elements via UniBee's admin console. Custom Checkout Page Overview ## Navigation & Access * **Navigation path:** `Product > Checkout Page` * **Access control:** * **Trial users:** View-only access to the default template * **Paid users:** Full CRUD access to all custom templates Navigation to Checkout Page ## Template Management ### Template List All templates are listed with the following fields: * Template name * Creation date / last modified date * Status: `Draft` or `Published` Search and filtering are supported by template name. Template List View ### Template Operations | Operation | Description | | --------- | ---------------------------------------------------------------------------- | | Create | Click `Add Template` to launch the creation wizard | | Edit | Modify any field, preview changes in real time | | Save | Draft changes are stored without affecting published template | | Publish | Confirm to apply latest changes | | Delete | Only allowed when template is not linked to any plan (confirmation required) | Template Operations ## Assigning Templates to Plans Each product plan can be optionally linked to a checkout template. * **Field:** `Checkout Page Template` * **Location:** Plan creation / edit form * **Behavior:** * If selected: the assigned template is rendered at checkout * If not selected: the default template is used Plan Template Assignment ## Template Configuration Templates consist of two main configuration tabs: ### Feature Settings Controls the fields and logic within the checkout form. #### Form Elements | Field | Type | Notes | | --------------- | ------------ | ------------------------------------------- | | Email | Input | Required, format validation | | Payment Methods | Multi-select | At least one required (e.g. Stripe, PayPal) | | Account Type | Radio | Personal / Business — triggers VAT fields | | Country | Dropdown | Affects tax logic | #### Order Summary * Product details: name, price, billing cycle * Coupon field: user input + apply button * Tax: automatically calculated and displayed (e.g. VAT(HK) 0% €0.00) #### Customer Details * Phone number (optional) * Billing address (optional) * Company name (optional, required for business accounts) #### Advanced Controls * Submit button text (e.g. "Continue", "Start Now") * Toggle banner / footer display Feature Settings Configuration ### Style Settings Adjust font, color, spacing, and layout settings to match brand identity. Live preview is provided alongside configuration for immediate feedback. Style Settings Configuration ## Business Rules * At least one payment method must be selected * Email is mandatory and format-validated * Country selection dynamically triggers tax recalculation * Business account selection forces VAT + company fields * Coupon logic triggers real-time price adjustment Business Rules Implementation ## Technical Specifications ### Frontend * Fully responsive (desktop + mobile) * Real-time configuration preview * Status management (draft vs. published) ### Backend * All template data is encrypted at rest * Strict separation between edit and publish environments * Template load performance: \< 1.5s ### Security * Trial and paid user access clearly separated * Deletion of in-use templates is restricted * Merchant data is isolated per account Technical Specifications ## UX & Interaction * Saving a draft does not affect live templates * Publishing requires confirmation modal * Deleting prompts warning and is blocked if linked to any plan * Required fields are marked with red asterisk (`*`) * Real-time success/failure messages are shown for all actions User Experience and Interaction ## Best Practices 1. **Start with a draft**: Always create and test templates in draft mode before publishing 2. **Test thoroughly**: Preview templates on different devices and screen sizes 3. **Keep it simple**: Avoid overly complex layouts that might confuse users 4. **Brand consistency**: Use your brand colors and fonts consistently 5. **Mobile-first**: Ensure templates work well on mobile devices 6. **Performance**: Keep customizations lightweight to maintain fast load times ## Troubleshooting * **Template not appearing**: Check if the template is published and assigned to the plan * **Changes not reflecting**: Ensure you've published the latest draft changes * **Cannot delete template**: Verify the template is not linked to any active plans * **Preview not working**: Clear browser cache and refresh the page # Custom Domain (CNAME) Configuration Source: https://docs.unibee.dev/documentation/business-integration/custom-domain-CNAME-configuration Configure a custom branded domain for UniBee hosted checkout and billing pages # Custom Domain Configuration (CNAME) Guide By configuring a Custom Domain (Custom Branding), you can replace UniBee's default hosted page URL with your own branded domain (e.g., `checkout.yourdomain.com`), providing a seamless and professional experience for your customers. *** ## 1. What is a CNAME? A **CNAME (Canonical Name)** record is a type of DNS record that maps an alias name (your subdomain) to a true or canonical domain name (UniBee's server). * **Simple Analogy**: Think of a CNAME as a "pointer." When a user visits `checkout.yourdomain.com`, the DNS record tells their browser to actually fetch the content from UniBee's servers. * **Restriction**: CNAME records must be set on a **subdomain** (e.g., `checkout` or `billing`) and cannot be applied to a root domain (e.g., `yourdomain.com`). *** ## 2. Benefits of Using a Custom Domain Setting up a CNAME record offers several key advantages: * **Brand Consistency**: Maintain your brand identity throughout the entire customer journey, from landing page to checkout. * **Increased Conversion**: Users are more likely to complete a purchase when they see a familiar domain in the address bar, reducing friction and bounce rates. * **Improved Tracking**: Custom domains simplify the setup of tracking pixels (like Facebook Pixel or Google Analytics) by keeping everything under a "First-Party" context. * **Enhanced Security**: Combined with SSL proxying, your custom domain ensures all transactions remain encrypted and secure. *** ## 3. Common Use Cases * **SaaS Platforms**: Use `billing.yoursoftware.com` for customer subscription management. * **E-commerce**: Use `pay.yourstore.com` for a branded checkout experience. * **Environment Testing**: Use separate subdomains for testing and production to avoid data pollution. *** ## 4. How to Get Your Configuration Depending on which mode you are currently using in the UniBee dashboard, record the following values: | Configuration Item | **Test Mode** | **Live Mode** | | :----------------- | :----------------------------------- | :--------------------------------------- | | **Record Type** | CNAME | CNAME | | **Host/Name** | Your chosen subdomain (e.g., `test`) | Your chosen subdomain (e.g., `checkout`) | | **Value/Target** | **`cs-sandbox.unibee.app`** | **`cs.unibee.app`** | *** ## 5. Recommended: Configuration via Cloudflare UniBee does not directly manage SSL certificates for custom domains. To ensure your domain is accessible via HTTPS, we strongly recommend using **Cloudflare** as your DNS provider to benefit from their SSL Proxy features. ### Why Cloudflare? * **Automatic SSL**: Cloudflare provides free Universal SSL certificates, removing the need for manual certificate management. * **Enhanced Security**: Benefit from Cloudflare's WAF and DDoS protection. * **Global Performance**: Speed up your checkout page loading times via Cloudflare's global Edge network. ### Cloudflare Setup Steps 1. **Add Record**: Log in to Cloudflare, go to **DNS > Records**, and click **Add Record**. 2. **Enter Details**: * **Type**: Select `CNAME`. * **Name**: Enter your subdomain (e.g., `checkout`). * **Target**: Paste the Value provided in the UniBee dashboard (`cs-sandbox.unibee.app` for Test or `cs.unibee.app` for Live). * **Proxy status**: **Must be enabled (Orange Cloud icon)**. This is required for SSL support. 3. **Configure SSL/TLS**: * Go to the **SSL/TLS** tab in Cloudflare. * Set the encryption mode to **Full** or **Full (Strict)**. 4. **Verify & Activate**: * Return to the UniBee **Custom Branding** page and click **Verify & Save Domain**. * Test the generated **Checkout Link** to ensure it loads correctly under your new domain. *** DNS propagation can take up to **24-48 hours** to complete worldwide. # Customer Portal After Purchases (Hosted Mode) Source: https://docs.unibee.dev/documentation/business-integration/customer-portal-after-purchases Use UniBee Hosted Customer Portal to let your customers manage subscriptions, invoices, and billing information after purchases with minimal integration. The **UniBee Hosted Customer Portal** is a secure, user-authenticated interface where your customers can **self-manage everything after purchases**, including: * Viewing current subscriptions and plans * Upgrading, downgrading, or cancelling subscriptions * Updating payment methods and billing information * Viewing invoices and payment history Compared with the **Change Subscription After Purchases (Hosted Mode)** page—which focuses mainly on **subscription changes**—the Customer Portal is a **broader, all‑in‑one experience** for end users. ## When to Use the Customer Portal Use the Customer Portal when you want to: * Provide a **single entry point** for customers to manage all their billing and subscriptions * Avoid building your own "My Account / Billing" UI * Offer self-service experiences (change plan, update card, view invoices) after checkout * Link to a hosted page from your app's **"Billing"** or **"Account"** menu If you only need a focused subscription change flow for a single plan, you can still use:\ [Change Subscription After Purchases (Hosted Mode)](/documentation/business-integration/change-subscription-hosted-page-after-purchases). ## How It Works The integration pattern is similar to the Subscription Update page: 1. Your backend calls a **Session API** to get a Customer Portal URL for a specific user. 2. Your frontend redirects the user to that URL. 3. The user completes actions in the hosted Customer Portal. 4. UniBee redirects the user back to your `returnUrl` or `cancelUrl`, and sends relevant Webhooks (e.g. subscription updated, invoice paid). ## Generate Customer Portal URL (Session API) You generate the Customer Portal URL via the **Session API**: **API Endpoint:** [Get Customer Portal URL](/api-reference/session/get-customer-portal-url) ```shell theme={null} curl --location --request POST "$UniBee_API_Host/merchant/session/customer_portal_url" \ --header "Authorization: Bearer $UNIBEE_API_KEY" \ --header 'Content-Type: application/json' \ --data '{ "email": "customer@example.com", "externalUserId": "your_user_id_123", "productId": 1001, "planId": 2001, "vatCountryCode": "DE", "returnUrl": "https://yourdomain.com/portal/success", "cancelUrl": "https://yourdomain.com/portal/cancel" }' ``` ### Request Behavior * **User identification**: * If `userId` is provided, UniBee uses it directly. * If `userId` is `0`, UniBee will try `externalUserId` first, then `email`. * If no user is found, the API returns `user not found`. * **Subscription resolution**: * UniBee will try to find the most relevant subscription for this user (optionally filtered by `productId`): * Prefer the latest **active / incomplete / creating** subscription. * Fallback to the latest subscription record. * If a subscription is found, the portal URL will include `subscriptionId` so the portal can focus on that subscription. * If no subscription is found, the portal URL is still valid (without `subscriptionId`) and the user can start their first purchase from the portal. * **Return URLs**: * `returnUrl`: where the user is redirected **after completing** actions in the portal. * `cancelUrl`: where the user is redirected if they **cancel or close** the portal without completing actions. ## Redirect the Customer After calling the Session API from your backend, redirect the user to the returned URL: ```javascript theme={null} // Example: from your backend API handler const response = await fetch('https://api.unibee.dev/merchant/session/customer_portal_url', { method: 'POST', headers: { Authorization: `Bearer ${process.env.UNIBEE_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ email: customerEmail, productId: 1001, planId: 2001, returnUrl: 'https://yourdomain.com/portal/success', cancelUrl: 'https://yourdomain.com/portal/cancel', }), }); const { data } = await response.json(); // In your frontend: window.location.href = data.url; // Redirect to UniBee Customer Portal ``` ## Handle Return Callback After the customer finishes in the Customer Portal, UniBee redirects them back to your `returnUrl` (or `cancelUrl`). You can handle the callback similarly to the checkout / subscription update flows: ```javascript theme={null} // Example: handle return from Customer Portal const urlParams = new URLSearchParams(window.location.search); const success = urlParams.get('success') === 'true'; if (success) { // Refresh user subscriptions / invoices from your backend await refreshBillingData(); showNotification('Billing information updated successfully!'); } else { // Optional: handle cancel case showNotification('Customer Portal was closed without changes.'); } ``` In addition, you should listen to corresponding [Webhooks](/documentation/webhooks/webhook-events.mdx) such as: * `subscription.updated` * `subscription.pending_update.success` * `invoice.paid` so your system can react to changes even if the frontend callback is interrupted. # Data migration guide Source: https://docs.unibee.dev/documentation/business-integration/data-migration-guide This guide mirrors the onboarding style used in the other UniBee business-integration docs. We start with a quick orientation, then walk through import and export scenarios with actionable steps, field guidance, and links to deeper references. *** ## 1. Quick orientation | Question | Answer | | ------------------------------ | --------------------------------------------------------------------------------------------- | | **Who is this for?** | Merchants who need to migrate data into UniBee or export existing information for BI/finance. | | **What objects can I import?** | Users, Plans, Active Subscriptions, and Subscription History. | | **What can I export?** | Any major dataset (users, plans, subscriptions, invoices, credits, reports) via UI or API. | | **How do I test safely?** | Use your Sandbox org first, verify results, then repeat in Production. | > ✅ **Tip:** Download the latest template right before filling it out. Templates change as UniBee evolves—using an old file is the #1 cause of import errors. *** ## 2. First things first 1. **Download UniBee’s Excel templates** – In UniBee Admin Portal, open any data list with a `⋯ → Import` button (for example, `User Management → User List`). Click **Download template** to grab the latest Excel file. All imports use these `.xlsx` templates; they already include required columns and guidance. 2. **Minimal viable import** – For teams that just need to bring existing customers online quickly: * Create the plans you need (manually in **Product & Plan** or via the Plan APIs). * Configure your payment gateways in UniBee (Settings → Payments). * Import **Active Subscriptions**. The import job auto-creates any missing users, so once the subscriptions are in place, the system is ready for use. 3. **When you need more control** – Move on to importing users and plans explicitly (details below) before adding subscriptions. This is helpful when you need precise external IDs, custom metadata, or audit requirements. 4. **Backup & permissions** – Make sure you can see the `⋯ → Import` menu (Billing Admin or higher) and export the existing dataset before importing to preserve a rollback point. *** ## 3. Import playbook ### 3.1 Templates & entry points | Task name | Portal entry | Template | | --------------------------- | ---------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | | `UserImport` | **User Management → User List → ⋯ → Import** | [Download template](https://api.unibee.dev/import/template/user_import) | | `ActiveSubscriptionImport` | **Subscription → Subscription List → ⋯ → Import active subscription** | [Download template](https://api.unibee.dev/import/template/active_subscription_import) | | `HistorySubscriptionImport` | **Subscription → Subscription List → ⋯ → Import subscription history** | [Download template](https://api.unibee.dev/import/template/history_subscription_import) | > Plan imports currently have **no UI**. If you need to bulk-create plans, call the Plan APIs directly (for example, `POST /merchant/plan/create`). Imported plans land in `Edit` status, so you can review them before activating. All templates are Excel files (≤ 20 MB). Use UTF‑8 when exporting CSV versions to avoid encoding issues. ### 3.1 User import | Field | Required | Description & tips | | ------------------------ | ------------- | -------------------------------------------------------------------------------------------- | | `Email` | ✅ | Primary identifier. Must be unique per merchant. | | `ExternalUserId` | ➖ Recommended | Keep your legacy system’s user ID here for reconciliation and future sync jobs. | | `FirstName` / `LastName` | ➖ | Display name shown in UniBee UI and exports. | | `Address`, `Phone` | ➖ | Optional profile fields; populate them if you want support teams to see legacy contact info. | * **After import**: Users are created in `ACTIVE` status. Existing users can only be overwritten if they were previously imported by the same admin (UniBee tags each record with `ImportBy` to enforce this). No webhook fires; check Activity Logs for `ImportNew` / `ImportOverride`. ### 3.2 Plan import (API workflow) * **How it works**: There is no “Import plan” button in the UI today. Use the Plan APIs (`/merchant/plan/create`, `/merchant/plan/edit`, etc.) to bulk-create plans based on the Excel template. For example: ```bash theme={null} curl --location --request POST "https://api.unibee.dev/merchant/plan/create" \ --header "Authorization: Bearer $UNIBEE_API_KEY" \ --header "Content-Type: application/json" \ --data '{ "productId": 123, "planName": "Pro Plan", "internalName": "pro_plan_internal", "externalPlanId": "legacy-plan-001", "amount": 9900, "currency": "USD", "intervalUnit": "month", "intervalCount": 1 }' ``` * **Key fields**: `ExternalPlanId`, `PlanName`, `InternalName`, `ProductName`, `PlanType`, `PlanAmount`, `Currency`, `IntervalUnit`, `IntervalCount`, plus optional `Metadata` and trial settings. * **After import**: Plans stay in **Edit** status until you review and activate them. This lets you double-check pricing and descriptions before customers see them. Duplicates update descriptive/trial fields. No webhook fires; audit via Activity Logs. ### 3.3 Active subscription import This is the heavy-lifter for migrations—you import a user’s ongoing subscription along with gateway/payment info. #### UI workflow 1. Go to **Subscription → Subscription List**. 2. Click the `Import` button in the top-right corner and choose **Import active subscription**. 3. Download the Excel template if needed, fill in the rows, upload the file, and monitor the task in the Task Drawer. #### API workflow You can also call the API directly to import a single subscription: ```bash theme={null} curl --location --request POST "https://api.unibee.dev/merchant/subscription/active_subscription_import" \ --header "Authorization: Bearer $UNIBEE_API_KEY" \ --header "Content-Type: application/json" \ --data '{ "externalSubscriptionId": "legacy-sub-1001", "planId": 456, "email": "user@example.com", "gateway": "stripe", "stripeUserId": "cus_123", "stripePaymentMethod": "pm_123", "currentPeriodStart": "2024-07-01 00:00:00", "currentPeriodEnd": "2024-08-01 00:00:00", "billingCycleAnchor": "2024-07-01 00:00:00", "firstPaidTime": "2024-06-15 00:00:00", "createTime": "2024-06-01 00:00:00" }' ``` | Field | Required | Description & tips | | --------------------------------------------------- | ------------ | --------------------------------------------------------------------------------------------------- | | `ExternalSubscriptionId` | ✅ | External identifier from your legacy system; needed for overrides and debugging. | | `Email` / `ExternalUserId` | ✅ (pick one) | Used to locate or auto-create the user. Provide both when possible so you’re safe if emails change. | | `PlanId` / `ExternalPlanId` | ✅ (pick one) | Must reference an existing UniBee plan. When using `ExternalPlanId`, ensure it already exists. | | `Gateway` | ✅ | e.g., `stripe`, `paypal`, `wire_transfer`. The gateway must be configured in UniBee. | | `GatewayPaymentType` | ➖ | Required for gateways that expose sub-types (e.g., Payssion). | | `StripeUserId` + `StripePaymentMethod` | ➖ | Needed to keep Stripe auto-charge working. | | `PaypalVaultId` or `PaypalAgreementToken` | ➖ | Needed to keep PayPal auto-charge working. | | `Quantity` | ➖ | Defaults to 1; useful for seat-based subscriptions. | | `CountryCode`, `VatNumber`, `TaxPercentage` | ➖ | Recommended for VAT/GST compliance. | | `CurrentPeriodStart` / `CurrentPeriodEnd` | ✅ | UTC timestamps; `End` must be greater than “now”. | | `BillingCycleAnchor`, `FirstPaidTime`, `CreateTime` | ✅ | Control proration, reporting, and the next renewal. | | `Features` | ➖ | JSON column for custom features/metadata. | * **After import**: * Subscription status = `Active`, type = `UniBeeControl`. * UniBee issues a zero-amount “catch-up” invoice so reports stay consistent. * User defaults (country, gateway, payment method) update. * Webhooks fire: * `subscription.import.created` (new record) * `subscription.import.override` (overwriting an existing import by the same admin) * Downstream events triggered by the zero invoice, such as `invoice.paid` and `user.metric.update`, so your billing system sees a consistent timeline. * Overrides are only allowed when the original subscription was imported by the same admin (metadata guard). ### 3.4 Subscription history import Use this to backfill past billing cycles (for example, when you want N months of historical revenue in UniBee). #### UI workflow 1. Go to **Subscription → Subscription List**. 2. Click the `Import` button and select **Import subscription history**. 3. Download the template, fill it out, upload, and track the background task just like other imports. #### API workflow Alternatively, import a single record via API: ```bash theme={null} curl --location --request POST "https://api.unibee.dev/merchant/subscription/history_subscription_import" \ --header "Authorization: Bearer $UNIBEE_API_KEY" \ --header "Content-Type: application/json" \ --data '{ "externalSubscriptionId": "legacy-sub-1001", "planId": 456, "email": "user@example.com", "gateway": "stripe", "currentPeriodStart": "2024-05-01 00:00:00", "currentPeriodEnd": "2024-06-01 00:00:00", "totalAmount": 9900 }' ``` | Field | Required | Description & tips | | ------------------------------------------ | ------------ | --------------------------------------------------------------- | | `ExternalSubscriptionId` | ✅ | Use the same ID as the active subscription so history lines up. | | `PlanId` / `ExternalPlanId` | ✅ | Points to the plan used during that billing period. | | `Email` / `ExternalUserId` | ✅ (pick one) | Same behavior as active import. | | `Gateway` | ✅ | Stored for auditing; UniBee does not charge anything here. | | `CurrentPeriodStart`, `CurrentPeriodEnd` | ✅ | Both must be in the past and `End > Start`. | | `TotalAmount` | ✅ | Period amount in cents. | | `Quantity`, `CountryCode`, `TaxPercentage` | ➖ | Optional context for analytics. | * **After import**: * UniBee creates an `Expired` subscription record plus a timeline slice for reporting. * It does **not** create a live subscription or trigger billing—it is purely historical. * Duplicate rows are rejected unless they belong to the same admin import. * No webhook fires; rely on Activity Logs. ### 3.5 Import flow (same for every task) 1. Download the template → fill one row per record. 2. Upload the file via the modal. UniBee immediately enqueues a background job. 3. Monitor progress in the Task Drawer (`Queued → Running → Succeeded/Failed`). 4. Download the annotated result file and check the `ImportResult` column. 5. Fix failed rows only, then re-upload. *** ## 4. Export playbook ### 4.1 Exports from list pages Every major list has `⋯ → Export`. Apply filters first (date range, plan, status) and UniBee will export just that slice. * **Users**: `userId`, `externalUserId`, `email`, `status`, `countryCode`, `defaultGatewayId`, timestamps. * **Plans**: `planId`, `externalPlanId`, `planName`, `planType`, `amount`, `currency`, `interval`, trial info. * **Subscriptions**: `subscriptionId`, `externalSubscriptionId`, `planName`, `status`, `gateway`, `amount`, `currency`, `currentPeriodStart/End`, `userId`. * **Transactions / Invoices**: invoice/payment IDs, statuses, `totalAmount`, `taxAmount`, `currency`, `paymentMethod`, `gateway`, timestamps. Exports run as background tasks; download them from the Task Drawer when they turn green. ### 4.2 Reports & Export Reports center For standardized report packs (subscription inventory, invoice ledger, credit balance history, etc.), go to **Reports & Export Reports**. These jobs use a fixed schema suitable for finance/compliance and can be rerun for any historical period. ### 4.3 API-driven exports Need automation? Use two endpoints: 1. `POST /merchant/task/new_export` with task name (e.g., `UserExport`, `SubscriptionExport`, `InvoiceExport`, `CreditTransactionExport`, `PlanExport`, `DiscountExport`, `UserDiscountExport`, `MultiUserDiscountExport`). Include: * `payload`: filters (date range, plan IDs, statuses, etc.). * `exportColumns` (optional): specify exact columns. * `format`: `xlsx` (default) or `csv`. 2. `GET /merchant/task/list` to poll for status and retrieve `downloadUrl`. Need a field dictionary? Call `/merchant/task/export_column_list` with the task name to get every column key plus human-readable descriptions. *** ## 5. Validation & go-live checklist 1. **Spot-check** – Open a few imported users/plans/subscriptions in the UI to confirm values (amounts, cycles, payment method, etc.). 2. **Billing smoke test** – For active subscriptions, trigger a manual invoice or wait for the next renewal to ensure auto-charge succeeds with the imported payment token. 3. **Audit trail** – `Admin Management → Activity Logs` shows `ImportNew`, `ImportOverride`, and export events. Download logs if you need compliance evidence. 4. **Communicate** – Share final task IDs and validation notes with finance/support so everyone knows when UniBee becomes the source of truth. *** ## 6. Troubleshooting & support * **Upload rejected immediately** → Most likely an outdated template or renamed columns. Download a fresh copy and reapply your data. * **“Task not found”** → Check spelling/casing of the `task` parameter (e.g., `ActiveSubscriptionImport`). * **Gateway errors** → Ensure Stripe/PayPal gateways are configured in UniBee; imports validate tokens against your credentials. * **Task stuck in “Running”** → Large files can take several minutes. If still running after \~30 minutes, download the task log or contact UniBee Support with the task ID. * **Encoding issues** → Save CSV files in UTF‑8, especially if your data includes non-English characters. Need help? Contact UniBee Support or your onboarding manager with the task ID, template, and a couple of sample rows for faster diagnosis. *** ## 7. Related resources * [User import/export walkthrough](/documentation/user-management/export-import-user-data) * [Subscription import API reference](/api-reference/subscription-import/active-subscription-importallows-repetition-imports) * [Reporting overview](/documentation/reports-and-export-reports/reports-and-export-reports) # Transaction Data Storage Source: https://docs.unibee.dev/documentation/business-integration/data-storage Understanding data storage for UniBee Opensource and Cloud versions ## Data Storage Overview UniBee offers two deployment modes, each with different transaction data storage approaches: ## Deployment Mode Comparison ```mermaid theme={null} graph TB A[UniBee Deployment Modes] --> B[Opensource] A --> C[Cloud] B --> D[Data stored on customer servers] B --> E[Customer's own database] B --> F[Complete data control] C --> G[Data stored on UniBee servers] C --> H[Customer can sync via Webhook] C --> I[Securely hosted data] style A fill:#e1f5fe style B fill:#f3e5f5 style C fill:#e8f5e8 style D fill:#fff3e0 style G fill:#fff3e0 ``` ## Opensource Version **Data Storage Location:** Stored on customer servers **Features:** * ✅ Data is completely stored in customer's own database * ✅ Customer has complete control over data * ✅ Complies with data sovereignty requirements * ✅ No concerns about data privacy * ✅ Can customize data storage strategies **Use Cases:** * Enterprises with strict data sovereignty requirements * Organizations that need complete data control * Teams with sufficient technical capabilities to maintain databases ## Cloud Version **Data Storage Location:** Stored on UniBee servers **Data Synchronization Method:** Customers can sync data back to their servers by integrating with UniBee Webhooks **Features:** * ✅ Data hosted by UniBee professional team * ✅ Automatic backup and disaster recovery * ✅ Real-time data synchronization via Webhooks * ✅ Reduced operational burden * ✅ High availability and security **Data Synchronization Flow:** ```mermaid theme={null} sequenceDiagram participant Client as Customer System participant UniBee as UniBee Cloud participant DB as Customer Database Note over UniBee: Transaction event occurs UniBee->>Client: Send Webhook notification Client->>DB: Store data in local database Client->>UniBee: Return confirmation response Note over Client,DB: Real-time data sync completed ``` **Use Cases:** * Enterprises looking to reduce operational costs * Organizations requiring professional data hosting * Businesses with real-time data synchronization requirements ## Selection Recommendations | Considerations | Opensource | Cloud | | ----------------- | ------------------------- | ------------------- | | Data Control | Complete control | Sync via Webhook | | Operational Cost | Self-maintenance required | Hosted service | | Data Sovereignty | Fully compliant | Requires evaluation | | Technical Barrier | Higher | Lower | | Real-time Access | Direct access | Via Webhook | Choose the appropriate deployment mode based on your specific requirements. If you have strict data sovereignty requirements, we recommend choosing the Opensource version; if you want to reduce operational burden and obtain professional data hosting services, the Cloud version is a better choice. # External Gateway Integration Guide Source: https://docs.unibee.dev/documentation/business-integration/external-gateway-integration Integrate your own payment system or third‑party checkout with UniBee using External Gateway Invoices, while UniBee manages subscriptions and invoicing. ## Overview **External Gateway** mode is designed for teams who want UniBee to manage **subscriptions, invoices, billing cycles and entitlements**, while **your own system or a third‑party gateway handles the actual payment and refunds**. In this model: * **UniBee handles**: * Subscription lifecycle and billing cycles * Invoice generation and status * Entitlement logic (activation, renewal, cancellation) * Webhooks to your backend * **Your system handles**: * Creating payment orders * Showing a checkout page / cashier * Executing charge and refund on your own gateway * Calling UniBee External Gateway APIs to report results Funds flow only between **your customer and your payment system**. UniBee does not charge cards directly; it updates invoice and subscription status based on the results you report. *** ## Data Flow at a Glance | Direction | Description | | ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **UniBee → Your System** | For payment attempts, UniBee creates or reuses a **Payment** and sends `payment.created` to tell you to charge. For refund tasks, UniBee sends `refund.created` to tell you to execute a refund. When users click “Pay” in UniBee UI, they stay on UniBee’s intermediate page until your backend calls [Update External Gateway Payment Link](/api-reference/payment/update-external-gateway-payment-link) (`POST /merchant/payment/external_gateway_payment/update_link`) to write `paymentLink` for that `paymentId`; then UniBee redirects the user to your payment URL. | | **Your System → UniBee** | After your gateway finishes a charge, call Payment APIs (`external_gateway_payment/mark_paid` or `mark_failed`). After your gateway finishes a refund, call Refund APIs (`external_gateway_refund/mark_success` or `mark_failed`) to sync Payment/Refund/Invoice/Subscription states in UniBee. | For high‑level product behavior from the invoice perspective, see also:\ [External Gateway Invoices](/documentation/invoices/external-gateway-invoices). *** ## 1. Configuration and Security ### 1.1 Configure External Gateway in UniBee Before integration, you need to configure one or more External Gateways in UniBee: 1. Log in as a merchant → **Configuration → Payment Gateways**. 2. Add and configure an **External Gateway** (similar to other gateways). 3. For each External Gateway, UniBee provides: * A unique **`gatewayId`** * An **External Gateway API Key** (also called **GatewayKey**) used **only** for HMAC signatures Use `gatewayId` to distinguish multiple external channels (e.g. `custom_gateway_A`, `custom_gateway_B`), and keep the GatewayKey strictly confidential. ### 1.2 Dual Authentication & Signature Rule All **External Gateway Payment / Refund APIs** share the same security model: 1. **Merchant OpenAPI auth** * HTTP header `Authorization: Bearer ` 2. **Request body signature** using the **GatewayKey**: * Signature string (concatenate with `|` in this exact order): * For **payment** APIs: `paymentId|externalTransactionId|timestamp` * For **refund** APIs: `refundId|externalRefundId|timestamp` * Algorithm: `HMAC-SHA256(GatewayKey, signatureString)` * Encoding: hex string used as `signature` * Anti‑replay: `timestamp` must be within UniBee’s accepted time window (currently implemented as ±12 hours). Use current Unix timestamp in seconds. ```text theme={null} // Payment APIs signatureString = paymentId + "|" + externalTransactionId + "|" + timestamp // Refund APIs signatureString = refundId + "|" + externalRefundId + "|" + timestamp signature = hex( HMAC_SHA256(GatewayKey, signatureString) ) ``` *** ## 2. Core APIs (Payment / Refund‑based) The new External Gateway flow is built around **Payment** and **Refund** resources. All integration endpoints live under `/merchant/payment/*`: ### 2.1 Update External Gateway Payment Link When your own gateway generates or changes a checkout URL, you can write it back to the UniBee **Payment** so invoice links / intermediate pages can redirect to the latest URL. * **API:** [Update External Gateway Payment Link](/api-reference/payment/update-external-gateway-payment-link)\ Path: `POST /merchant/payment/external_gateway_payment/update_link` Typical fields (see API reference for full schema): * `paymentId` — UniBee Payment ID * `externalTransactionId` — your order / payment ID * `paymentLink` — your hosted checkout URL * `timestamp`, `signature` — using the signing rule above UniBee always uses the most recently updated `paymentLink`. ### 2.2 Mark External Gateway Payment as Paid After your external gateway confirms that a payment has succeeded, you report the result at the Payment level: * **API:** [Mark External Gateway Payment As Paid](/api-reference/payment/mark-external-gateway-payment-as-paid)\ Path: `POST /merchant/payment/external_gateway_payment/mark_paid` Effects: * Marks the corresponding Payment as **Paid** * Transitions the related Invoice to **Paid** * Triggers subscription activation / renewal logic * Emits related webhooks (for example `invoice.paid`, `subscription.updated`) Common fields: * `paymentId` — UniBee Payment ID * `externalTransactionId` — your payment order ID (used as an idempotency key) * `paidTime` — timestamp when payment succeeded (optional) * `metadata` — extra information (optional) * `timestamp`, `signature` > Repeated calls with the same `(paymentId, externalTransactionId)` are idempotent and will not double‑charge or double‑record revenue. ### 2.3 Mark External Gateway Payment as Failed When a payment attempt ultimately fails or you give up retries, you can explicitly mark the Payment as failed: * **API:** [Mark External Gateway Payment As Failed](/api-reference/payment/mark-external-gateway-payment-as-failed)\ Path: `POST /merchant/payment/external_gateway_payment/mark_failed` This helps your internal systems track failure reasons and allows UniBee to correctly update invoice / subscription state or drive further retry logic as configured. ### 2.4 Report External Gateway Refund Result Refunds are reported via dedicated **Refund** resources rather than directly on the invoice: * **API:** [Mark External Gateway Refund As Success](/api-reference/payment/mark-external-gateway-refund-as-success)\ Path: `POST /merchant/payment/external_gateway_refund/mark_success` * **API:** [Mark External Gateway Refund As Failed](/api-reference/payment/mark-external-gateway-refund-as-failed)\ Path: `POST /merchant/payment/external_gateway_refund/mark_failed` Typical fields (see API reference for full schema): * `refundId` — UniBee refund ID * `externalRefundId` — your external refund transaction ID * `timestamp`, `signature` — using the refund signing rule above Refund trigger source: * UniBee sends `refund.created` when a refund task is created for an External flow. * Your system executes the refund in your gateway. * Then your backend reports the final refund result with: * `external_gateway_refund/mark_success`, or * `external_gateway_refund/mark_failed`. After you create or execute a refund in your own gateway: 1. Create or obtain the corresponding Refund on UniBee side (implementation details depend on your setup). 2. Call one of the Refund APIs to mark it **successful** or **failed**. 3. UniBee will: * Update refund status and amount * Move the Invoice into partially or fully refunded states * Emit refund‑related webhooks for your internal systems. *** ## 3. Webhooks: `payment.created` and `refund.created` When UniBee decides it’s time to attempt payment for an External Gateway invoice (for example, before renewal, or when the user clicks “Pay”), it creates or reuses a **Payment** and sends a **`payment.created`** webhook. `payment.created` is a **payment-only** trigger. Refund handling is a separate flow based on `refundId` and the External Gateway refund result APIs. For External Gateway, refund execution should be driven by **`refund.created`** webhook events, not by `payment.created`. ### 3.1 Identifying External Payments In your webhook handler: * Check `payment.gatewayId` in the payload and compare it with your known External `gatewayId`s, **or** * Inspect the `gateway` object and check that: * `gateway.gatewayType == 8` (External), or * `gateway.gatewayName == "external"` (depending on your configuration) Once identified as External: 1. Read `invoiceId`, `paymentId`, amount and currency from the event. 2. Create/attach an order in your own system. 3. Decide when/how to charge the user (immediately, or later). 4. After the charge succeeds, call **`external_gateway_payment/mark_paid`**; if there is a refund, report it via `external_gateway_refund/mark_success` / `mark_failed`. ### 3.2 Typical Timing * Renewal invoices are usually generated **a few days** before the period end. * Around **2 hours before** the billing period ends (configurable), UniBee: * Creates or reuses a Payment * Sends one `payment.created` event for External gateways * For subsequent automatic attempts, UniBee reuses the same Payment and **does not** send additional `payment.created` events. You only need to react to the first `payment.created` per Payment. *** ## 4. Integration Patterns ### Pattern A: UniBee Checkout / Invoice Link + External Redirect 1. Your app calls UniBee to create a subscription / invoice with an External Gateway. 2. UniBee creates an External Gateway Payment for that invoice and returns an invoice or Checkout link. 3. When the user clicks “Pay”, UniBee opens an **External Gateway intermediate page**: * This page polls the current Payment and waits for a `paymentLink`. 4. Your backend calls `external_gateway_payment/update_link` with your checkout URL. 5. Once the intermediate page sees a valid `paymentLink`, it redirects the user to your checkout. 6. After the payment succeeds, your backend calls `external_gateway_payment/mark_paid`, and UniBee updates the Payment / Invoice / Subscription state accordingly. ### Pattern B: Your Own Checkout Only (No UniBee UI) 1. Your backend calls UniBee to create subscriptions or invoices with an External Gateway and stores the `invoiceId` / `paymentId`. 2. You use your own frontend and checkout; the user never visits UniBee’s pages. 3. After the payment succeeds in your gateway, you call `external_gateway_payment/mark_paid`. 4. If there is a refund, you report it via `external_gateway_refund/mark_success` / `mark_failed`. In this pattern you typically do not need to call `external_gateway_payment/update_link`. ### Pattern C: Invoice Email / Invoice Center If you rely on UniBee’s invoice emails or invoice center: * Integrate `external_gateway_payment/update_link` so that the “Pay” button on the invoice always points to your latest valid checkout URL. * Whenever your order URL changes or expires, call this endpoint again; UniBee will always use the newest value. *** ## 5. Best Practices * **Use UniBee as the source of truth for invoices and subscriptions**\ Even if your gateway handles the money, keep all invoices and subscription state in UniBee so reporting and entitlement logic stay consistent. * **Drive state from your gateway events**\ Only call the External Gateway Payment / Refund APIs after your own gateway definitively confirms the result (via its own webhook or API). * **Keep payment links fresh**\ If your checkout URLs can expire or change, always update them via `external_gateway_payment/update_link` before the user clicks “Pay”. * **Subscribe to UniBee webhooks**\ Subscribe to both **`payment.created`** (payment execution trigger) and **`refund.created`** (refund execution trigger), and also consume result events such as `invoice.paid`, `refund.success`, and `subscription.updated` for downstream sync. * **Leverage idempotency**\ Use stable external IDs per operation (`externalTransactionId` for payment, `externalRefundId` for refund). Repeating the same call with the same key tuple is safe — UniBee treats it as idempotent and avoids duplicate state transitions. # Hosted page custom domain Source: https://docs.unibee.dev/documentation/business-integration/hosted-page-custom-domain Configure a custom domain for your UniBee-hosted checkout and subscription management pages, so customers can access these pages through your own branded URL instead of the default UniBee domain. ## Overview The **Hosted Page Custom Domain** feature allows merchants to map a custom subdomain, such as `checkout.yourcompany.com`, to UniBee-hosted pages. After configuration is completed, customers can open hosted checkout or subscription-related pages using your branded domain. This helps deliver a more consistent brand experience and improves trust during customer-facing billing flows. *** ## Benefits Using a custom hosted page domain helps you: * present checkout and subscription pages under your own brand * create a more seamless customer journey * improve trust during payment and subscription actions * support a more polished white-label billing experience *** ## Supported Scenarios This feature is commonly used in the following scenarios: ### Branded checkout flow Use your own subdomain for hosted checkout pages instead of exposing the default UniBee page URL. ### Subscription management under your brand Keep subscription-related self-service pages aligned with your company domain. ### White-label SaaS experience Provide a more professional and consistent billing experience for end users. *** ## Before You Start Before configuring a custom domain, make sure you have: * a domain or subdomain managed through your DNS provider * permission to update DNS records * a DNS provider that supports SSL proxying, such as Cloudflare > UniBee does not directly manage SSL certificates for custom domains. To make your custom domain accessible via HTTPS, you must use a DNS provider that supports SSL proxying. *** ## How It Works To enable a custom hosted page domain, you need to create a DNS **CNAME** record that points your custom subdomain to the UniBee target domain shown in the configuration page. The general setup flow is: 1. Enter your custom subdomain in UniBee. 2. Copy the DNS record information provided by UniBee. 3. Create the required CNAME record in your DNS provider. 4. Wait for DNS propagation. 5. Return to UniBee and click **Verify & Save Domain**. 6. After successful verification, the custom domain becomes active. *** ## Where to Configure Go to: **Settings → Custom Branding** In this section, you can: * enter your custom hosted page domain * view the required DNS record * verify the domain after DNS setup * check current configuration status UniBee Checkout Return Config2 Page *** ## Configure a Custom Domain ### Step 1: Enter your custom subdomain In the **Custom Checkout Domain** field, enter the subdomain you want to use for hosted pages. Example: `checkout.yourcompany.com` > We recommend using a dedicated subdomain instead of a root domain. ### Step 2: Review the required DNS record UniBee will display the DNS record you need to create. Example: * **Record Type:** `CNAME` * **Host/Name:** `checkout` * **Value/Target:** `cs-sandbox.unibee.app` The exact target value may vary depending on the current environment. ### Step 3: Add the CNAME record in your DNS provider Go to your DNS provider and create the record exactly as shown in UniBee. Make sure: * the record type is `CNAME` * the host/name matches the configured subdomain prefix * the target value matches the value shown in UniBee ### Step 4: Configure SSL proxy mode If you are using Cloudflare or a similar provider, configure SSL/TLS properly to ensure HTTPS access. Recommended setup: * **SSL/TLS Mode:** `Full` or `Flexible` * **Do not use:** `Full (Strict)` * make sure the CNAME record is **proxied** > `Full (Strict)` is not supported because UniBee does not provide origin SSL certificates for merchant custom domains. ### Step 5: Verify and save the domain After the DNS record has been added, return to UniBee and click **Verify & Save Domain**. If the verification succeeds, the domain will be saved and activated for hosted pages. *** ## DNS Configuration Reference UniBee provides environment-specific DNS instructions. For example, in the test environment, the target may point to a sandbox domain such as: `cs-sandbox.unibee.app` Make sure you are configuring DNS for the correct environment before verifying the domain. *** ## SSL Certificate Requirement UniBee does not manage SSL certificates for custom domains. To use HTTPS on your custom domain, you must rely on a DNS or proxy provider that can handle SSL termination for your domain. For providers such as Cloudflare: * use supported SSL/TLS modes * enable proxying on the CNAME record * avoid strict origin validation modes that require an origin certificate from UniBee *** ## Verification Status The Hosted Page Custom Domain section may show a status such as: * **Not Configured**: no custom domain has been set up yet * **Configured / Verified**: the domain has been validated and is ready to use If the domain cannot be verified, check your DNS settings and wait for propagation to complete. *** ## Notes ### DNS propagation delay DNS updates may take up to **24–48 hours** to propagate globally. During this time, verification may fail temporarily. ### Use a subdomain We recommend using a dedicated subdomain such as: * `checkout.yourcompany.com` * `billing.yourcompany.com` ### Check DNS accuracy carefully If verification fails, confirm that: * the record type is correct * the host/name is correct * the target value matches exactly * the proxy mode is enabled if required by your DNS provider * DNS propagation has completed *** ## Result After Successful Configuration Once setup is complete, your UniBee-hosted pages can be accessed through your own branded domain. This means: * customers see your domain instead of the default UniBee URL * checkout and subscription flows feel more consistent * your billing experience looks more professional and trustworthy *** ## FAQ ### Can I use my root domain directly? We recommend using a subdomain, such as `checkout.yourcompany.com`, instead of a root domain. ### Why do I need to configure DNS myself? Because the domain belongs to your organization, DNS ownership and routing must be managed through your own DNS provider. ### Why is `Full (Strict)` not supported? UniBee does not issue origin SSL certificates for merchant custom domains in this setup, so strict origin certificate validation is not supported. ### Why does verification fail even after I created the DNS record? Common reasons include: * DNS propagation is still in progress * the CNAME record is incorrect * proxy or SSL/TLS mode is configured incorrectly * the domain was configured for the wrong environment # Integration Workflow Guide Source: https://docs.unibee.dev/documentation/business-integration/integration-workflow A comprehensive guide for integrating UniBee checkout and subscription management into your business system This guide walks you through the complete integration workflow, from onboarding new customers through checkout to managing existing subscriptions. Follow these steps to seamlessly integrate UniBee into your application. ## Overview The integration workflow consists of two main phases: 1. **New Customer Onboarding** - Getting customers signed up through UniBee checkout 2. **Subscription Management** - Allowing customers to view and manage their subscriptions ### 🚀 Quick Integration: UniBee Hosted Pages (Recommended) To minimize integration effort and accelerate time-to-market, UniBee provides **two ready-to-use hosted pages**: | Feature | Integration Effort | Use Case | | ---------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- | ----------------------------------------------------------- | | **[Checkout Purchases (Hosted Mode)](/documentation/business-integration/checkout-purchases)** | **Minimal** - Copy checkout link and configure return URL | First-time purchases, zero frontend code required | | **[Change Subscription (Hosted Mode)](/documentation/business-integration/change-subscription-hosted-page-after-purchases)** | **Low** - One API call to generate hosted page URL | Subscription management (upgrade, downgrade, renew, cancel) | **Why use Hosted Pages?** * ✅ **Hours to days** vs weeks to months of custom development * ✅ **PCI compliant** - UniBee handles payment security * ✅ **Mobile optimized** - Responsive design out of the box * ✅ **Conversion optimized** - Tested checkout flows * ✅ **Focus on core business** - UniBee handles billing infrastructure > 💡 **Recommendation:** Start with hosted pages for fast integration. You can always build custom UI using UniBee's APIs later if needed. *** ## Part 1: New Customer Onboarding > 💡 **Quick Start:** This phase uses UniBee's [Checkout Purchases (Hosted Mode)](/documentation/business-integration/checkout-purchases) - a fully functional hosted checkout page that requires zero frontend code and minimal integration effort. ### Step 1: Using Checkout Links UniBee provides checkout links for each active Plan. These links enable customers to complete purchases without requiring authentication in your system. * **Access Location**: Copy the checkout link from the Plan definition page in UniBee Admin Portal * **Usage**: Direct customers to the checkout link to initiate their first purchase * **No Authentication Required**: Customers can complete checkout without being logged into your system **Key Benefits of Hosted Checkout:** * Zero frontend code required * PCI compliance handled automatically * Mobile-optimized and conversion-tested * Handles payment processing and customer information collection For more details, see [Checkout Purchases (Hosted Mode)](/documentation/business-integration/checkout-purchases). ### Step 2: Handling Return URL After Purchase After a customer successfully completes checkout, UniBee redirects them back to your system using the Return URL configured at the Product definition page. **Return URL Format:** ``` ${returnUrl}?email={Customer Email}&paymentId={UniBeePaymentId}&subId={UniBeeSubscriptionId}&invoiceId={UniBeeInvoiceId}&success=true ``` **URL Parameters:** | Parameter | Description | | ----------- | ------------------------------------------------------ | | `email` | The customer's email address | | `paymentId` | The UniBee payment ID generated for this purchase | | `subId` | The UniBee subscription ID created for the customer | | `invoiceId` | The UniBee invoice ID for the initial invoice | | `success` | Boolean flag indicating successful checkout completion | **Implementation Example:** ```javascript theme={null} // Parse return URL parameters const urlParams = new URLSearchParams(window.location.search); const email = urlParams.get('email'); const paymentId = urlParams.get('paymentId'); const subId = urlParams.get('subId'); const invoiceId = urlParams.get('invoiceId'); const success = urlParams.get('success') === 'true'; if (success) { // Proceed with onboarding logic handleOnboarding(email, subId, invoiceId); } ``` ### Step 3: Completing Your Business Logic After receiving the return callback, complete your system's onboarding workflow: 1. **Customer Registration**: Create the customer account in your system using the email from the return URL 2. **Password Setup**: Prompt the customer to set up their password 3. **Account Activation**: Activate the customer's account and grant access You can retrieve detailed customer and subscription information using one of the following methods: #### Option A: Using Invoice API Use the `invoiceId` from the return URL to fetch complete invoice details: ```shell theme={null} curl --location --request GET "$UniBee_API_Host/merchant/invoice/invoice_detail" \ --header "Authorization: Bearer $UNIBEE_API_KEY" \ --header 'Content-Type: application/json' \ --data '{ "invoiceId": "$invoiceId" }' ``` The response includes: * Customer details (email, name, billing address) * Subscription information * Payment details * Invoice line items See [Invoice API Reference](/api-reference/invoice/invoice-detail-1) for detailed response schema. #### Option B: Using Subscription API Alternatively, use the `subId` to fetch subscription details: ```shell theme={null} curl --location --request GET "$UniBee_API_Host/merchant/subscription/subscription_detail" \ --header "Authorization: Bearer $UNIBEE_API_KEY" \ --header 'Content-Type: application/json' \ --data '{ "subscriptionId": "$subId" }' ``` See [Subscription API Reference](/api-reference/subscription/subscription-detail-1) for detailed response schema. ### Step 4: Setting Up Webhooks (Recommended) For a robust integration, subscribe to UniBee webhook events. This ensures your system stays synchronized even if the return URL callback fails or is delayed. **Recommended Webhook Events:** | Event | Description | When It Fires | | ------------------------ | --------------------------- | ----------------------------------------------------------------------------------------- | | `subscription.activated` | Subscription becomes active | After customer completes checkout (or when subscription is assigned and payment succeeds) | | `invoice.paid` | Invoice payment successful | Whenever any invoice payment completes successfully | | `user.metric.update` | User's plan metrics changed | When the customer's subscription plan changes | **Quick Setup Steps:** 1. **Create Webhook Endpoint** in UniBee Admin Portal: * Navigate to **Configuration → Webhooks → Webhook Endpoints** * Click **Add Webhook Endpoint** * Enter your endpoint URL (e.g., `https://yourdomain.com/webhooks/unibee`) * Select the events listed above 2. **Verify Webhook Requests**: UniBee provides two verification methods: * **API Key Verification**: Check the `Authorization` header contains your API key (simpler) * **HMAC Signature Verification**: Validate the `X-Signature` header using HMAC-SHA256 (more secure) You can choose either method or implement both for maximum security. 3. **Handle Webhook Events**: Process incoming events based on the `EventType` header 4. **Return Response**: Your endpoint must return HTTP **200** with body content **"success"** > 📚 **For detailed implementation guide, code examples, and complete verification documentation, see [Webhooks Documentation](/documentation/webhooks/webhooks)** For a list of all available webhook events, see [Webhook Events](/documentation/webhooks/webhook-events). *** ## Part 2: Subscription Management for Existing Customers > 💡 **Quick Start:** For subscription management, UniBee provides [Change Subscription (Hosted Mode)](/documentation/business-integration/change-subscription-hosted-page-after-purchases) - a secure hosted page that handles upgrades, downgrades, renewals, cancellations, and payment method updates with minimal integration (just one API call). Once customers have completed onboarding and logged into your system, you can provide them with tools to view and manage their subscriptions. ### Step 1: Displaying Customer Profile Retrieve the customer's subscription details to build a comprehensive profile UI: **API Endpoint:** [Get User Subscription Detail](/api-reference/subscription/user-subscription-detail-1) ```shell theme={null} curl --location --request GET "$UniBee_API_Host/merchant/subscription/user_subscription_detail" \ --header "Authorization: Bearer $UNIBEE_API_KEY" \ --header 'Content-Type: application/json' \ --data '{ "email": "customer@example.com" }' ``` **Response Includes:** * Current subscription status * Active plan details * Billing cycle information * Next billing date * Payment method * Invoice history * Usage metrics (if applicable) **UI Elements to Display:** * Current plan name and pricing * Subscription status badge (Active, Cancelled, Pending, etc.) * Next billing date and amount * Billing cycle (monthly, yearly, etc.) * Payment method on file * Recent invoices with download links ### Step 2: Building Pricing UI Create a pricing page that shows available plans: 1. **Fetch Available Plans**: Use the [Get Plan List API](/api-reference/plan/get-plan-list-1) to retrieve all active plans 2. **Display Plans**: Show plan features, pricing, and billing cycles 3. **Highlight Current Plan**: Indicate which plan the customer is currently subscribed to 4. **Action Buttons**: Provide "Upgrade" or "Downgrade" buttons for each plan ### Step 3: Handling Plan Changes (Upgrade, Downgrade, Renew) When a customer selects a new plan, redirect them to UniBee's Subscription Update Hosted Page. This hosted page handles all subscription changes securely with built-in authentication and real-time previews. **Benefits:** * One API call to generate the hosted page URL * Handles all subscription lifecycle operations (upgrade, downgrade, renew, cancel) * Secure user authentication built-in * Shows customers exactly what changes will occur before confirming **Implementation:** **Step 3a: Generate Update Page URL** Call the Session API to get the hosted update page URL: **API Endpoint:** [Get User Subscription Update Page URL](/api-reference/session/get-user-subscription-update-page-url-1) ```shell theme={null} curl --location --request POST "$UniBee_API_Host/merchant/session/user_sub_update_url" \ --header "Authorization: Bearer $UNIBEE_API_KEY" \ --header 'Content-Type: application/json' \ --data '{ "email": "customer@example.com", "externalUserId": "your_user_id_123", "planId": 456, "productId": 789, "returnUrl": "https://yourdomain.com/subscription/update-success", "cancelUrl": "https://yourdomain.com/subscription/update-cancelled", "vatCountryCode": "US" }' ``` **Response:** ```json theme={null} { "code": 0, "data": { "url": "https://cs.unibee.dev/hosted/sub_update?session=xxx&env=prod" } } ``` **Step 3b: Redirect Customer** Redirect the customer to the URL from the API response: ```javascript theme={null} // User clicks "Upgrade to Pro Plan" const response = await fetch('/api/get-update-url', { method: 'POST', body: JSON.stringify({ email: customerEmail, planId: targetPlanId, returnUrl: 'https://yourdomain.com/subscription/update-success' }) }); const { url } = await response.json(); window.location.href = url; // Redirect to UniBee hosted page ``` **Step 3c: Handle Return Callback** After the customer completes the update on UniBee's hosted page, they'll be redirected back to your `returnUrl`. Handle the callback similar to the checkout return: ```javascript theme={null} // Handle return from subscription update const urlParams = new URLSearchParams(window.location.search); const success = urlParams.get('success') === 'true'; if (success) { // Refresh subscription details await refreshSubscriptionDetails(); // Show success message showNotification('Subscription updated successfully!'); } ``` **What Happens Behind the Scenes:** 1. UniBee creates a `PendingUpdate` record (subscription doesn't change immediately) 2. Customer completes payment on the hosted page 3. After successful payment: * Webhook events are sent: `subscription.pending_update.success`, `invoice.paid`, `subscription.updated` * Subscription status updates to reflect the new plan * New billing cycle begins For more details, see [Change Subscription After Purchases (Hosted Mode)](/documentation/business-integration/change-subscription-hosted-page-after-purchases). *** ## Testing with Sandbox Before going live, test your integration using UniBee's Sandbox environment: 1. **Use Sandbox API**: Point your integration to `https://api-sandbox.unibee.top` 2. **Configure Sandbox Checkout Links**: Use sandbox checkout links (they'll have `env=sandbox` in the URL) 3. **Test Webhooks**: * **Option A**: Deploy your webhook endpoint to a public URL (e.g., a staging server or cloud function) * **Option B**: Use a local development tool (e.g., [ngrok](https://ngrok.com/), [localtunnel](https://localtunnel.github.io/www/), or similar) to temporarily expose your local webhook endpoint to the internet * **Webhook URL Requirements**: Your webhook endpoint must be publicly accessible via HTTPS URL. UniBee will send POST requests to your configured webhook URL. 4. **Test Payment Flows**: Use test cards (see [Testing Cards](/documentation/business-integration/testing-cards)) 5. **Simulate Subscription Events**: Use UniBee's subscription simulation feature to quickly test subscription lifecycle events (invoices, renewals, etc.) without waiting for real-time intervals. This allows you to advance time and observe how subscriptions behave over extended periods. See [Simulate Subscriptions (Sandbox)](/documentation/business-integration/simulate-subscriptions) for detailed instructions. 6. **Verify Webhook Events**: Monitor webhook deliveries in UniBee Admin Portal to ensure events are received correctly *** ## Integration Checklist Use this checklist to ensure your integration is complete: ### Onboarding Flow * [ ] Checkout links configured and accessible * [ ] Return URL configured at Product level * [ ] Return URL parameters parsed correctly * [ ] Customer registration logic implemented * [ ] Password setup flow completed * [ ] Invoice/Subscription API integration for fetching details * [ ] Webhook endpoint configured * [ ] Webhook signature verification implemented * [ ] Webhook event handlers for `subscription.activated`, `invoice.paid`, `user.metric.update` ### Subscription Management * [ ] User subscription detail API integrated * [ ] Profile UI displaying subscription information * [ ] Pricing page with available plans * [ ] Subscription update page URL generation implemented * [ ] Redirect to UniBee hosted update page working * [ ] Return URL handling for update completion * [ ] Webhook handlers for update-related events ### Testing * [ ] Sandbox environment tested * [ ] Test cards used for payment flows * [ ] Webhook events verified * [ ] Error handling implemented * [ ] Edge cases tested (cancelled subscriptions, failed payments, etc.) *** ## Related Documentation * [Checkout Purchases (Hosted Mode)](/documentation/business-integration/checkout-purchases) * [Change Subscription After Purchases (Hosted Mode)](/documentation/business-integration/change-subscription-hosted-page-after-purchases) * [Make Billing API Calls](/documentation/business-integration/billing-api-call) * [Webhooks](/documentation/webhooks/webhooks) * [Webhook Events](/documentation/webhooks/webhook-events) * [Testing Cards](/documentation/business-integration/testing-cards) * [Simulate Subscriptions (Sandbox)](/documentation/business-integration/simulate-subscriptions) * [Subscription Status](/documentation/subscription/status) # UniBee Multi-Currencies Module Source: https://docs.unibee.dev/documentation/business-integration/multi-currencies-module Support global billing in multiple currencies with flexible rule sets and exchange logic ## 1️⃣ Feature Overview The **Multi-Currencies Module** enables merchants to configure and manage multiple currencies across subscription plans, usage-based billing, and discount codes.\ This feature helps UniBee merchants sell globally, ensuring customers can view and pay in their preferred currencies — while maintaining accurate conversions and centralized control. **Key Highlights:** * Centralized configuration of multiple currencies * Real-time or manual exchange rate management * Independent multi-currency rule sets per region or pricing logic * Automatic currency conversion across Plans and Discount Codes * Manual price override options for flexibility > 💡 *Ideal for SaaS companies expanding internationally, or those offering multi-regional pricing.* *** ## 2️⃣ Configuration Module ### 🔧 Access Path **Configuration → Multi-Currency Configuration** ### 🧩 Functional Description | Section | Description | | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | **Exchange API Configuration** | Integrate external exchange rate APIs (e.g., CurrencyLayer, OpenExchangeRates). Input the API Key and enable/disable the feature. | | **Multi-Currency Rule Sets** | Create independent sets of currencies with conversion rules. Each rule set defines one Default Currency and multiple optional currencies. | | **Exchange Rate Logic** | - If both manual and API rates exist → manual takes priority.
- If API enabled but no manual rates → use API.
- If API disabled → use manual rates only. | | **Validation** | - Default Currency cannot appear in more than one rule set.
- “Rule Set Name” and “Default Currency” are mandatory fields. | *** ## 3️⃣ Plan Setup (Pricing Configuration) ### ⚙️ Logic When creating or editing a Plan, the **Default Currency** determines which **Rule Set** applies.\ The system automatically displays converted prices for all currencies defined in the rule set. ### 💡 Key Behaviors | Step | Action | Description | | ---- | ---------------------------- | --------------------------------------------------------------------------------------- | | 1 | Enter Default Currency price | The entered price becomes the base reference. | | 2 | System auto-converts | Other currencies are calculated based on rule set exchange logic. | | 3 | Manual override | Users can manually adjust converted prices for flexibility. | | 4 | Remove currencies | Merchants can remove specific currencies (applies only to this Plan, not the rule set). | *** ## 4️⃣ Usage-Based Billing (Advanced) ### ⚙️ Behavior For usage-based pricing models, the system auto-displays the converted prices of each additional currency derived from the rule set. * **Default Currency:** editable input * **Additional Currencies:** read-only, auto-converted based on exchange logic > ✏️ No manual editing is allowed here — ensures billing accuracy across metrics. *** ## 5️⃣ Discount Codes Module ### 💰 Fixed-Amount Discount Conversion When creating fixed-amount discount codes: * Input a value in the Default Currency * The system auto-displays equivalent amounts in other currencies * Conversion follows the same exchange rate priority logic **Example:** > Default Currency = EUR → €10 discount → automatically displays USD, GBP, CNY equivalents. Screenshot 4 – Discount Code Conversion *** ## 6️⃣ Exchange Logic Summary | Condition | Logic Applied | | -------------------------- | --------------------------------------------------------------------------------------------- | | API + Manual | Manual rates take priority | | API only | Use API rates | | API disabled | Use manual rates only | | Missing Default Currency | Block save and show error | | Duplicate Default Currency | Show error: *“Default Currency already exists in another rule set and cannot be duplicated.”* | *** ## 7️⃣ Example Scenarios | Use Case | Description | | ----------------------------- | ------------------------------------------------------------------------ | | **Global SaaS** | One rule set per region (EU, US, APAC) with different default currencies | | **Custom Enterprise Pricing** | Manually override converted prices for negotiated enterprise plans | | **Multi-gateway Routing** | Combine with payment gateway routing for full regional flexibility | *** ## 8️⃣ Summary of Benefits ✅ Centralized and flexible global currency management\ ✅ Seamless integration with existing billing, metric, and discount systems\ ✅ Accurate exchange rates with manual override flexibility\ ✅ Reduced operational overhead for international pricing setup *** ## 9️⃣ Recommended Image Order | # | Image Description | Suggested Placement | | - | ------------------------------------------- | ------------------- | | 1 | Multi-Currency Configuration Page | Section 2 | | 2 | Plan Setup (multi-currency pricing table) | Section 3 | | 3 | Usage-Based Billing conversion table | Section 4 | | 4 | Discount Code with currency conversion | Section 5 | | 5 | Validation error popup (duplicate currency) | Section 6 | # OpenAPI MCP Server Source: https://docs.unibee.dev/documentation/business-integration/openapi-mcp Connect to UniBee’s public MCP endpoint to search OpenAPI definitions, generate example requests, and read integration playbooks—documentation only, no business API proxy. ## Overview UniBee exposes a **Model Context Protocol (MCP)** service over HTTPS so agents and integrators can **discover and understand** the UniBee OpenAPI surface. It helps you search endpoints, inspect schemas, generate example `curl` commands, and follow scenario playbooks. | Item | Value | | ----------------------- | -------------------------------------------- | | **Production endpoint** | `https://api.unibee.dev/mcp` | | **Protocol** | JSON-RPC 2.0 | | **Purpose** | OpenAPI documentation retrieval and examples | This service is **documentation-only**. It does **not** execute UniBee business APIs on your behalf. *** ## Agent configuration Add a **remote MCP server** in your agent or IDE and set the URL to: ```text theme={null} https://api.unibee.dev/mcp ``` Example configuration (field names may differ by platform): ```json theme={null} { "mcpServers": { "unibee-openapi": { "url": "https://api.unibee.dev/mcp" } } } ``` If the platform requires an explicit transport: ```json theme={null} { "mcpServers": { "unibee-openapi": { "url": "https://api.unibee.dev/mcp", "transport": "http" } } } ``` *** ## Service boundaries * The MCP endpoint returns **OpenAPI metadata** (paths, parameters, schemas, example curls, integration hints). It does **not** substitute for calling UniBee production or sandbox APIs from your own systems. * Tools such as `generate_example_request` output **example** HTTP requests you copy and run yourself after filling real credentials and business fields. * You do **not** need Node.js or a local checkout of this docs repo to use the MCP server. *** ## Authentication Connecting to the MCP server **does not** require a UniBee merchant **Bearer token**. The MCP layer is intended for public documentation access. Keep two concepts separate: | Concern | Behavior | | ------------------------- | -------------------------------------------------------------------------------------------------------- | | **MCP connection** | No business API token required to call `https://api.unibee.dev/mcp`. | | **Real UniBee API calls** | Use the authentication required by each business endpoint (typically `Authorization: Bearer `). | The optional `authToken` argument on `generate_example_request` is only used to **embed a token inside the generated example curl** for convenience. It is **not** the MCP server’s own auth parameter. If omitted, examples use a placeholder such as `Authorization: Bearer `. *** ## JSON-RPC methods Supported methods: * `initialize` * `tools/list` * `tools/call` *** ## Available tools | Tool | Purpose | | -------------------------- | -------------------------------------------------- | | `list_specs` | List available OpenAPI document sources. | | `search_endpoints` | Search endpoints by keyword, tag, or path prefix. | | `get_endpoint` | Return full detail for one path + HTTP method. | | `generate_example_request` | Build an example curl for a given path and method. | | `integration_playbook` | Return step-by-step guidance for common scenarios. | ### `search_endpoints` * `query` (optional): keyword across path, summary, description * `tag` (optional): filter by OpenAPI tag * `pathPrefix` (optional): filter by URL prefix * `limit` (optional): default 20, max 100 ### `get_endpoint` * `path` (required), e.g. `/merchant/plan/list` * `method` (required), e.g. `GET` or `POST` ### `generate_example_request` * `path` (required) * `method` (required) * `authToken` (optional): inserted into the generated example `Authorization` header only ### `integration_playbook` * `scenario` (required), one of: * `merchant_subscription` * `checkout_payment` * `system_refund` *** ## Example requests ### Initialize ```bash theme={null} curl -X POST "https://api.unibee.dev/mcp" \ -H "Content-Type: application/json" \ -d '{ "jsonrpc":"2.0", "id":1, "method":"initialize", "params":{} }' ``` ### List tools ```bash theme={null} curl -X POST "https://api.unibee.dev/mcp" \ -H "Content-Type: application/json" \ -d '{ "jsonrpc":"2.0", "id":2, "method":"tools/list", "params":{} }' ``` ### Call `search_endpoints` ```bash theme={null} curl -X POST "https://api.unibee.dev/mcp" \ -H "Content-Type: application/json" \ -d '{ "jsonrpc":"2.0", "id":3, "method":"tools/call", "params":{ "name":"search_endpoints", "arguments":{ "query":"subscription", "limit":10 } } }' ``` ### Call `generate_example_request` ```bash theme={null} curl -X POST "https://api.unibee.dev/mcp" \ -H "Content-Type: application/json" \ -d '{ "jsonrpc":"2.0", "id":4, "method":"tools/call", "params":{ "name":"generate_example_request", "arguments":{ "path":"/merchant/plan/list", "method":"GET" } } }' ``` The responses above come from the **MCP documentation service**. Any curl inside the tool output is an **example** for UniBee business APIs—you still run those requests from your own environment with real credentials and parameters. *** ## Recommended workflow 1. Call `integration_playbook` with your scenario. 2. Use `search_endpoints` to find relevant routes. 3. Use `get_endpoint` to read request/response schemas and security requirements. 4. Use `generate_example_request` to draft a curl, then add real auth and body fields. 5. Execute the business API from your own application or API client. *** ## Summary UniBee’s **OpenAPI MCP** helps you **explore and document** the API faster; it does **not** replace authenticated calls to UniBee business endpoints from your systems. # Payment iframe integration (Embedded) Source: https://docs.unibee.dev/documentation/business-integration/payment-iframe-integration Embed UniBee payments into your app using iframe with embedded UI mode ## Overview UniBee Payment supports iframe integration for seamless payment experiences. By setting `PaymentUIMode` to `"embedded"` in API requests, you can embed payment pages directly into your application using an iframe, eliminating the need for page redirects. ### Architecture Overview ```mermaid theme={null} graph TB A[Client Application] --> B[UniBee API] B --> C{PaymentUIMode} C -->|embedded| D[Return Payment URL] C -->|hosted| E[Redirect to Payment Page] D --> F[Create iframe with Payment URL] F --> G[UniBee Payment Page in iframe] G --> H[User Completes Payment] H --> I[Payment Status Message] I --> J[Handle Payment Result] style A fill:#e1f5fe style B fill:#f3e5f5 style G fill:#e8f5e8 style J fill:#fff3e0 ``` ## API Integration ### Supported Endpoints The following API endpoints support iframe integration: | Endpoint | Description | PaymentUIMode Support | | ------------------------------------------------------------------------------------------------ | ------------------------------ | --------------------- | | [`/checkout/subscription/create_submit`](/api-reference/subscription/create-subscription) | Create subscription (checkout) | ✅ | | [`/merchant/subscription/create_submit`](/api-reference/subscription/create-subscription) | Create subscription (merchant) | ✅ | | [`/merchant/subscription/update_submit`](/api-reference/subscription-update/update-subscription) | Update subscription (merchant) | ✅ | | [`/merchant/payment/new`](/api-reference/payment/new-payment) | Create one-time payment | ✅ | ### Request Parameters Add the `PaymentUIMode` parameter to your API requests: ```json theme={null} { "paymentUIMode": "embedded", // ... other parameters } ``` ### Response Structure When `PaymentUIMode` is set to `"embedded"`, the API returns: ```json theme={null} { "status": 10, "paymentId": "pay_xxx", "invoiceId": "inv_xxx", "link": "https://api.unibee.dev/embedded/payment_checker?paymentId=pay_xxx&env=prod", "action": { // Payment gateway specific data } } ``` **Key Fields**: * `link`: The payment page URL to embed in iframe * `paymentId`: Unique payment identifier * `invoiceId`: Unique invoice identifier * `action`: Gateway-specific payment data ### API Integration Flow ```mermaid theme={null} sequenceDiagram participant Client as Client App participant API as UniBee API participant Gateway as Payment Gateway Client->>API: POST /merchant/payment/new
{paymentUIMode: "embedded"} API->>Gateway: Create Payment Intent Gateway-->>API: Payment Created API-->>Client: Response with payment URL Note over Client: Extract link from response Client->>Client: Create iframe with payment URL Client->>Gateway: Load payment page in iframe Note over Gateway: User completes payment Gateway->>Client: PostMessage with payment status Client->>Client: Handle payment result ``` ## Frontend Integration ### Frontend Integration Flow ```mermaid theme={null} graph TD A[User Clicks Payment Button] --> B[Call createPayment API] B --> C{API Response} C -->|Success| D[Extract payment URL] C -->|Error| E[Show Error Message] D --> F[Create iframe Element] F --> G[Set iframe src to payment URL] G --> H[Show Payment Modal] H --> I[User Interacts with Payment Page] I --> J[Payment Gateway Processes Payment] J --> K{Payment Result} K -->|Success| L[Receive UniBee_PaymentSuccess Message] K -->|Failed| M[Receive UniBee_PaymentFailed Message] K -->|Cancelled| N[Receive UniBee_PaymentCancelled Message] L --> O[Close Modal & Handle Success] M --> P[Close Modal & Show Error] N --> Q[Close Modal & Show Cancellation] style A fill:#e3f2fd style B fill:#f3e5f5 style H fill:#e8f5e8 style O fill:#c8e6c9 style P fill:#ffcdd2 style Q fill:#fff9c4 ``` ### 1. Basic iframe Setup ```html theme={null} Payment Integration
``` ### 2. React Integration Example ```jsx theme={null} import React, { useState, useEffect } from 'react'; const PaymentModal = ({ paymentUrl, onClose, onSuccess, onFailure, onCancel }) => { useEffect(() => { const handleMessage = (event) => { // Security verification // if (event.origin !== 'https://api.unibee.dev') return; const { type, paymentId, invoiceId } = event.data; switch (type) { case 'UniBee_PaymentSuccess': onSuccess?.(paymentId, invoiceId); break; case 'UniBee_PaymentFailed': onFailure?.(paymentId, invoiceId); break; case 'UniBee_PaymentCancelled': onCancel?.(paymentId, invoiceId); break; } }; window.addEventListener('message', handleMessage); return () => window.removeEventListener('message', handleMessage); }, [onSuccess, onFailure, onCancel]); return (