curl --request POST \
--url https://api.unibee.dev/merchant/subscription/renew \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"applyPromoCredit": true,
"applyPromoCreditAmount": 123,
"cancelUrl": "<string>",
"discount": {
"cycleLimit": 123,
"discountAmount": 123,
"discountPercentage": 123,
"endTime": 123,
"metadata": {},
"recurring": true
},
"discountCode": "<string>",
"gatewayId": 123,
"gatewayPaymentType": "<string>",
"manualPayment": true,
"metadata": {},
"paymentUIMode": "<string>",
"productData": {
"description": "<string>",
"name": "<string>"
},
"productId": 123,
"returnUrl": "<string>",
"subscriptionId": "<string>",
"taxPercentage": 123,
"userId": 123
}
'{
"code": 123,
"data": {
"action": {},
"invoiceId": "<string>",
"link": "<string>",
"paid": true,
"paymentId": "<string>",
"subscription": {
"addonData": "<string>",
"amount": 123,
"billingCycleAnchor": 123,
"cancelAtPeriodEnd": 123,
"cancelOrExpireTime": 123,
"cancelReason": "<string>",
"countryCode": "<string>",
"createTime": 123,
"currency": "<string>",
"currentPeriodEnd": 123,
"currentPeriodPaid": 123,
"currentPeriodStart": 123,
"defaultPaymentMethodId": "<string>",
"dunningTime": 123,
"externalSubscriptionId": "<string>",
"features": "<string>",
"firstPaidTime": 123,
"gasPayer": "<string>",
"gatewayId": 123,
"gatewayStatus": "<string>",
"id": 123,
"lastUpdateTime": 123,
"latestInvoiceId": "<string>",
"link": "<string>",
"merchantId": 123,
"metadata": {},
"originalPeriodEnd": 123,
"pendingUpdateId": "<string>",
"planId": 123,
"productId": 123,
"quantity": 123,
"returnUrl": "<string>",
"status": 123,
"subscriptionId": "<string>",
"taskTime": "<string>",
"taxPercentage": 123,
"testClock": 123,
"trialEnd": 123,
"type": 123,
"userId": 123,
"vatNumber": "<string>"
}
},
"message": "<string>",
"redirect": "<string>",
"requestId": "<string>"
}renew an exist subscription
curl --request POST \
--url https://api.unibee.dev/merchant/subscription/renew \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"applyPromoCredit": true,
"applyPromoCreditAmount": 123,
"cancelUrl": "<string>",
"discount": {
"cycleLimit": 123,
"discountAmount": 123,
"discountPercentage": 123,
"endTime": 123,
"metadata": {},
"recurring": true
},
"discountCode": "<string>",
"gatewayId": 123,
"gatewayPaymentType": "<string>",
"manualPayment": true,
"metadata": {},
"paymentUIMode": "<string>",
"productData": {
"description": "<string>",
"name": "<string>"
},
"productId": 123,
"returnUrl": "<string>",
"subscriptionId": "<string>",
"taxPercentage": 123,
"userId": 123
}
'{
"code": 123,
"data": {
"action": {},
"invoiceId": "<string>",
"link": "<string>",
"paid": true,
"paymentId": "<string>",
"subscription": {
"addonData": "<string>",
"amount": 123,
"billingCycleAnchor": 123,
"cancelAtPeriodEnd": 123,
"cancelOrExpireTime": 123,
"cancelReason": "<string>",
"countryCode": "<string>",
"createTime": 123,
"currency": "<string>",
"currentPeriodEnd": 123,
"currentPeriodPaid": 123,
"currentPeriodStart": 123,
"defaultPaymentMethodId": "<string>",
"dunningTime": 123,
"externalSubscriptionId": "<string>",
"features": "<string>",
"firstPaidTime": 123,
"gasPayer": "<string>",
"gatewayId": 123,
"gatewayStatus": "<string>",
"id": 123,
"lastUpdateTime": 123,
"latestInvoiceId": "<string>",
"link": "<string>",
"merchantId": 123,
"metadata": {},
"originalPeriodEnd": 123,
"pendingUpdateId": "<string>",
"planId": 123,
"productId": 123,
"quantity": 123,
"returnUrl": "<string>",
"status": 123,
"subscriptionId": "<string>",
"taskTime": "<string>",
"taxPercentage": 123,
"testClock": 123,
"trialEnd": 123,
"type": 123,
"userId": 123,
"vatNumber": "<string>"
}
},
"message": "<string>",
"redirect": "<string>",
"requestId": "<string>"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
renew an exist subscription
apply promo credit or not
apply promo credit amount, auto compute if not specified
CancelUrl, back to cancelUrl if renew cancelled
Show child attributes
the count limitation of subscription recurring cycle, recurring need enable if cycleLimit set
Amount of discount
Percentage of discount, 100=1%, ignore if discountAmount set
end of discount available utc time
Discount recurring enable, default false
DiscountCode, override subscription discount
GatewayId, use subscription's gateway if not provide
Gateway Payment Type
ManualPayment
The checkout UI Mode, hosted|embedded|custom, default hosted
default product will use if not specified
ReturnUrl, back to returnUrl if renew completed
SubscriptionId, id of subscription which addon will attached, either SubscriptionId or UserId needed, The only one active subscription or latest subscription will renew if userId provide instead of subscriptionId
TaxPercentage,1000 = 10%, override subscription taxPercentage if provide
UserId, either SubscriptionId or UserId needed, The only one active subscription or latest cancel|expire subscription will renew if userId provide instead of subscriptionId
Show child attributes
The unique id of invoice
The unique id of payment
Show child attributes
plan addon json data
amount, cent
billing_cycle_anchor
whether cancel at period end,0-false | 1-true
the cancel or expire time, utc time, 0 if subscription not in cancelled or expired status
create utc time
currency
current_period_end, utc time
current period paid or not, 1-paid, other-the utc time to expire
current_period_start, utc time
dunning_time, utc time
external_subscription_id
features
first success payment time
who pay the gas, merchant|user
gateway_id
latest_invoice_id
merchant id
original_period_end, utc time
plan id
product id
quantity
status,1-Pending|2-Active|3-PendingInActive | 4-Cancel | 5-Expire | 6- Suspend| 7-Incomplete | 8-Processing | 9- Failed
subscription id
task_time
TaxPercentage,1000 = 10%
test_clock, simulator clock for subscription, if set , sub will out of cronjob controll
trial_end, utc time
sub type, 0-gateway sub, 1-unibee sub
userId