Overview
This guide explains how to integrate Promo Credits for your customers using UniBee’s OpenAPI endpoints. You will learn how to retrieve user promo credit accounts, preview subscription updates with promo credits applied, and submit subscription updates.Note: We will also provide dedicated documentation for user-side integration of promo credits later at Promo Credits Introduction.
Relative API Endpoints
1. Get User Profile
- Endpoint:
GET /merchant/user/get - Important Field:
promoCreditAccounts: List of promo credit accounts associated with the user.
2. Subscription Update Preview
- Endpoint:
POST /merchant/subscription/update_preview - Request Fields:
applyPromoCredit(boolean): Whether to apply promo credits.applyPromoCreditAmount(number): The amount of promo credit to apply.
- Response Fields:
invoice.promoCreditAccount: The promo credit account used.invoice.promoCreditPayout: Promo credit payout information.invoice.promoCreditDiscountAmount: Discount amount applied using promo credit.invoice.partialCreditPaidAmount: Amount partially paid using promo credits.invoice.promoCreditTransaction: Transaction details related to promo credit usage.
3. Subscription Update Submit
- Endpoint:
POST /merchant/subscription/update_submit - Request Fields:
applyPromoCredit(boolean): Whether to apply promo credits.applyPromoCreditAmount(number): The amount of promo credit to apply.
Integration Flow
-
Fetch User Promo Credit Information
- Call
GET /merchant/user/getto retrieve user’s promo credit accounts.
- Call
-
Preview Subscription Update
- Before submitting any update, call
POST /merchant/subscription/update_previewwithapplyPromoCreditandapplyPromoCreditAmountto preview the effect. - Review the
invoiceresponse to confirm how promo credits will be applied.
- Before submitting any update, call
-
Submit Subscription Update
- Once confirmed, call
POST /merchant/subscription/update_submitwith the same promo credit fields to apply the changes.
- Once confirmed, call
Notes
- Ensure that the
applyPromoCreditAmountdoes not exceed the available balance in the user’s promo credit account. - Promo credits are deducted immediately upon successful subscription update submission and connected to its invoice, and the Promo credits will be rollbacked to customer’s account when its relative invoice refund totally (partially refund will not rollback)
For further enhancements and examples, please check Promo Credits Introduction soon!

