Skip to main content
POST
New Subscription Onetime Addon Preview

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.

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

Preview for subscription onetime addon purchase

addonId
integer<int64>
required

AddonId, id of one-time addon, the new payment will created base on the addon's amount'

quantity
integer<int64>
required

Quantity, quantity of the new payment which one-time addon purchased

applyPromoCredit
boolean<*bool>

apply promo credit or not

applyPromoCreditAmount
integer<*int64>

apply promo credit amount, auto compute if not specified

currency
string<string>

The currency of payment

discountAmount
integer<*int64>

Amount of discount

discountCode
string<string>

DiscountCode

discountPercentage
integer<*int64>

Percentage of discount, 100=1%, ignore if discountAmount specified

gatewayId
integer<*int64>

GatewayId, use user's gateway if not provide

gatewayPaymentType
string<string>

Gateway Payment Type

metadata
object

Metadata,custom data

subscriptionId
string<string>

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<*int64>

TaxPercentage,1000 = 10%, default user's taxPercentage if not specified

userId
integer<int64>

UserId, either SubscriptionId or UserId needed, The only one active subscription will update if userId provide instead of subscriptionId

Response

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