Skip to main content
POST
Active Subscription Import(allows repetition imports)

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.

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.

StripePaymentMethod
string<string>

The stripe payment method id which user attached, get from stripe, required if stripe auto-charge needed

StripeUserId
string<string>

The stripe customer id of user get from stripe, required if stripe auto-charge needed

billingCycleAnchor
string<string>

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

createTime
string<string>

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

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'

discount
object
email
string<string>

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

expectedTotalAmount
integer<int64>

Optional. Unit: cents. If greater than 0, the system will verify the calculated total amount against this value

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

features
string<string>

In json format, additional features data of subscription, will join user's metric data in user api if provided'

firstPaidTime
string<string>

UTC time, the first payment success time of subscription, format '2006-01-02 15:04:05'

gateway
string<string>

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

gatewayPaymentType
string<string>
importProrationBase
object
metadata
object

Metadata,Map

paypalAgreementToken
string<string>

The billing agreement token of user payment method while billing agreement reference transaction enabled, required if paypal auto-charge needed

paypalVaultId
string<string>

The paypal vault id of user payment method, get from paypal while vault permission enabled, required if paypal auto-charge needed

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 tax percentage. Only applicable when the system VAT gateway not setup. Value is in thousandths (e.g., 1000 = 10%).

vatNumber
string<string>

The Vat Number of user

Response

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