Skip to main content
POST
New Subscription Onetime Addon Payment

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.

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

Create payment for subscription onetime addon purchase

addonId
integer<int64>
required

AddonId, id of one-time addon plan. The new payment amount is calculated from the addon amount and quantity

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

bypassSubCheck
boolean<bool>

When SubscriptionId is blank, allow purchase even if no active/incomplete subscription is found. If a subscription is found, the addon still attaches to it

cancelUrl
string<string>

CancelUrl, back to cancelUrl if user cancel the payment

currency
string<string>

The currency of payment

description
string<string>

Custom product description for payment gateway and invoice line display

discountAmount
integer<*int64>

Amount of discount

discountCode
string<string>

DiscountCode

discountPercentage
integer<*int64>

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

email
string<string>

Email. Used with ExternalUserId when SubscriptionId is blank and UserId is not provided

externalUserId
string<string>

ExternalUserId, unique. Used with Email when SubscriptionId is blank and UserId is not provided

gatewayId
integer<*int64>

GatewayId, use user's gateway if not provide

gatewayPaymentType
string<string>

Gateway Payment Type

manualPayment
boolean<*bool>

Optional. Defaults to true. If true, do not charge the saved payment method automatically; return a checkout link for manual payment instead.

metadata
object

Metadata,custom data

name
string<string>

Custom product name for payment gateway and invoice line display. Does not change InvoiceName

paymentUIMode
string<string>

Optional. Checkout UI mode: hosted | embedded | custom. Default is hosted.

returnUrl
string<string>

ReturnUrl, the addon's payment will redirect based on the returnUrl provided when it's back from gateway side

subscriptionId
string<string>

SubscriptionId, id of subscription which addon will attach to. If blank, UserId or ExternalUserId&Email is required

taxPercentage
integer<*int64>

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

userId
integer<int64>

UserId. Required when SubscriptionId is blank unless ExternalUserId&Email is provided

Response

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