Skip to main content
POST
History Subscription Import(Allows repetition imports)

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.

Parameters

Parameters for this endpoint are listed below. The schema is also shown in the Try it panel.

Request body


Request examples

cURL

Sandbox


Response

Success responses return a JSON envelope with code, data, message, redirect, and requestId. code 0 indicates success.

Error handling

When code in the response body is non-zero, check message for details. Use requestId when contacting support.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Each repetition import overrides existing subscriptions with matching ExternalSubscriptionId.

countryCode
string<string>

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<string>

Required, UTC time, the current period end time of subscription, format '2006-01-02 15:04:05'

currentPeriodStart
string<string>

Required, UTC time, the current period start time of subscription, format '2006-01-02 15:04:05'

email
string<string>

The email of user, one of Email or ExternalUserId is required

externalPlanId
string<string>

The external id of plan, one of planId or ExternalPlanId is required, plan should created at UniBee at first

externalSubscriptionId
string<string>

Required, The external id of subscription

externalUserId
string<string>

The external id of user, one of Email or ExternalUserId is required

gateway
string<string>

Required, should one of stripe|paypal|wire_transfer|changelly

gatewayPaymentType
string<string>
metadata
object

Metadata,Map

planId
integer<int64>

The id of plan, one of planId or ExternalPlanId is required, plan should created at UniBee at first

quantity
integer<int64>

the quantity of plan, default 1 if not provided

taxPercentage
integer<int64>

The TaxPercentage of subscription, Only applicable when the system VAT gateway not setup, 1000 = 10%

totalAmount
integer<int64>

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.

Response

200 - application/json
code
integer<int>
data
object
merchantId
integer<int64>
message
string<string>
redirect
string<string>
requestId
string<string>