https://api.unibee.dev/merchant/subscription/payment/new
New Subscription Payment
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <your_api_key> |
Content-Type | Yes | application/json (for request body) |
| Name | Type | Required | Description |
|---|---|---|---|
cancelUrl | string | No | CancelUrl |
countryCode | string | No | CountryCode |
currency | string | No | Currency, either Currency&TotalAmount or PlanId needed |
description | string | No | Description |
email | string | No | Email, either ExternalUserId&Email or UserId needed |
externalPaymentId | string | No | ExternalPaymentId should unique for payment |
externalUserId | string | No | ExternalUserId, unique, either ExternalUserId&Email or UserId needed |
gasPayer | string | No | who pay the gas, merchant|user |
gatewayId | integer | Yes | GatewayId |
items | array | No | Items |
metadata | object | No | Metadata,Map |
name | string | No | Name |
planId | integer | No | PlanId, either TotalAmount&Currency or PlanId needed |
redirectUrl | string | No | Redirect Url |
totalAmount | integer | No | Total PaymentAmount, Cent, either TotalAmount&Currency or PlanId needed |
userId | integer | No | UserId, either ExternalUserId&Email or UserId needed |
code, data, message, redirect, and requestId. code 0 indicates success.
| Field | Type | Description |
|---|---|---|
code | integer | Response code. 0 = success |
data | object | Response payload |
data.action | object | |
data.externalPaymentId | string | The external unique id of payment |
data.link | string | |
data.paymentId | string | The unique id of payment |
data.status | integer | Status, 10-Created|20-Success|30-Failed|40-Cancelled |
message | string | Human-readable message |
requestId | string | Request ID for support |
| HTTP status | Meaning |
|---|---|
| 400 | Bad request — invalid or missing parameters. Check message in the body. |
| 401 | Unauthorized — missing or invalid API key. |
| 404 | Not found — invalid path or resource. |
| 500 | Server error — retry with backoff. |
code in the response body is non-zero, check message for details. Use requestId when contacting support.Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
GatewayId
CancelUrl
CountryCode
Currency, either Currency&TotalAmount or PlanId needed
Description
Email, either ExternalUserId&Email or UserId needed
ExternalPaymentId should unique for payment
ExternalUserId, unique, either ExternalUserId&Email or UserId needed
who pay the gas, merchant|user
Items
Metadata,Map
Name
PlanId, either TotalAmount&Currency or PlanId needed
Redirect Url
Total PaymentAmount, Cent, either TotalAmount&Currency or PlanId needed
UserId, either ExternalUserId&Email or UserId needed