curl --request POST \
--url https://api.unibee.dev/merchant/plan/new \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 123,
"currency": "<string>",
"planName": "<string>",
"addonIds": [
123
],
"autoChargeConfig": {
"autoChargeLeadTime": 123,
"autoChargeMaxRetryCount": 123,
"autoChargeRetryInterval": 123,
"incompleteExpireTime": 123
},
"autoUpgradePlanId": 123,
"cancelAtTrialEnd": 123,
"checkoutTemplateId": 123,
"compareAtAmount": 123,
"description": "<string>",
"disableAutoCharge": 123,
"externalPlanId": "<string>",
"gasPayer": "<string>",
"homeUrl": "<string>",
"imageUrl": "<string>",
"internalName": "<string>",
"intervalCount": 123,
"intervalUnit": "<string>",
"metadata": {},
"metricLimits": [
{
"metricId": 123,
"metricLimit": 123
}
],
"metricMeteredCharge": [
{
"chargeType": 123,
"graduatedAmounts": [
{
"endValue": 123,
"flatAmount": 123,
"perAmount": 123,
"startValue": 123
}
],
"metricId": 123,
"standardAmount": 123,
"standardStartValue": 123
}
],
"metricRecurringCharge": [
{
"chargeType": 123,
"graduatedAmounts": [
{
"endValue": 123,
"flatAmount": 123,
"perAmount": 123,
"startValue": 123
}
],
"metricId": 123,
"standardAmount": 123,
"standardStartValue": 123
}
],
"multiCurrencies": [
{
"amount": 123,
"autoExchange": true,
"currency": "<string>",
"disable": true,
"exchangeRate": 123,
"fixedAmount": 123
}
],
"multiTrials": [
{
"intervalCount": 123,
"intervalUnit": "<string>",
"metadata": {},
"name": "<string>",
"trialCompareAtPrice": 123,
"trialDuration": 123,
"trialPrice": 123
}
],
"onetimeAddonIds": [
123
],
"productDescription": "<string>",
"productId": 123,
"productName": "<string>",
"tagIds": [
123
],
"trialAmount": 123,
"trialDemand": "<string>",
"trialDurationTime": 123,
"type": 1,
"usVATConfig": {
"active": true,
"fromAddress": {
"address": "<string>",
"city": "<string>",
"countryCode": "<string>",
"state": "<string>",
"verified": true,
"zipCode": "<string>"
},
"nexusAddresses": [
{
"address": "<string>",
"city": "<string>",
"countryCode": "<string>",
"state": "<string>",
"verified": true,
"zipCode": "<string>"
}
],
"sellOnUSOnly": true,
"taxCode": "<string>",
"toAddress": {
"address": "<string>",
"city": "<string>",
"countryCode": "<string>",
"state": "<string>",
"verified": true,
"zipCode": "<string>"
}
}
}
'import requests
url = "https://api.unibee.dev/merchant/plan/new"
payload = {
"amount": 123,
"currency": "<string>",
"planName": "<string>",
"addonIds": [123],
"autoChargeConfig": {
"autoChargeLeadTime": 123,
"autoChargeMaxRetryCount": 123,
"autoChargeRetryInterval": 123,
"incompleteExpireTime": 123
},
"autoUpgradePlanId": 123,
"cancelAtTrialEnd": 123,
"checkoutTemplateId": 123,
"compareAtAmount": 123,
"description": "<string>",
"disableAutoCharge": 123,
"externalPlanId": "<string>",
"gasPayer": "<string>",
"homeUrl": "<string>",
"imageUrl": "<string>",
"internalName": "<string>",
"intervalCount": 123,
"intervalUnit": "<string>",
"metadata": {},
"metricLimits": [
{
"metricId": 123,
"metricLimit": 123
}
],
"metricMeteredCharge": [
{
"chargeType": 123,
"graduatedAmounts": [
{
"endValue": 123,
"flatAmount": 123,
"perAmount": 123,
"startValue": 123
}
],
"metricId": 123,
"standardAmount": 123,
"standardStartValue": 123
}
],
"metricRecurringCharge": [
{
"chargeType": 123,
"graduatedAmounts": [
{
"endValue": 123,
"flatAmount": 123,
"perAmount": 123,
"startValue": 123
}
],
"metricId": 123,
"standardAmount": 123,
"standardStartValue": 123
}
],
"multiCurrencies": [
{
"amount": 123,
"autoExchange": True,
"currency": "<string>",
"disable": True,
"exchangeRate": 123,
"fixedAmount": 123
}
],
"multiTrials": [
{
"intervalCount": 123,
"intervalUnit": "<string>",
"metadata": {},
"name": "<string>",
"trialCompareAtPrice": 123,
"trialDuration": 123,
"trialPrice": 123
}
],
"onetimeAddonIds": [123],
"productDescription": "<string>",
"productId": 123,
"productName": "<string>",
"tagIds": [123],
"trialAmount": 123,
"trialDemand": "<string>",
"trialDurationTime": 123,
"type": 1,
"usVATConfig": {
"active": True,
"fromAddress": {
"address": "<string>",
"city": "<string>",
"countryCode": "<string>",
"state": "<string>",
"verified": True,
"zipCode": "<string>"
},
"nexusAddresses": [
{
"address": "<string>",
"city": "<string>",
"countryCode": "<string>",
"state": "<string>",
"verified": True,
"zipCode": "<string>"
}
],
"sellOnUSOnly": True,
"taxCode": "<string>",
"toAddress": {
"address": "<string>",
"city": "<string>",
"countryCode": "<string>",
"state": "<string>",
"verified": True,
"zipCode": "<string>"
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 123,
currency: '<string>',
planName: '<string>',
addonIds: [123],
autoChargeConfig: {
autoChargeLeadTime: 123,
autoChargeMaxRetryCount: 123,
autoChargeRetryInterval: 123,
incompleteExpireTime: 123
},
autoUpgradePlanId: 123,
cancelAtTrialEnd: 123,
checkoutTemplateId: 123,
compareAtAmount: 123,
description: '<string>',
disableAutoCharge: 123,
externalPlanId: '<string>',
gasPayer: '<string>',
homeUrl: '<string>',
imageUrl: '<string>',
internalName: '<string>',
intervalCount: 123,
intervalUnit: '<string>',
metadata: {},
metricLimits: [{metricId: 123, metricLimit: 123}],
metricMeteredCharge: [
{
chargeType: 123,
graduatedAmounts: [{endValue: 123, flatAmount: 123, perAmount: 123, startValue: 123}],
metricId: 123,
standardAmount: 123,
standardStartValue: 123
}
],
metricRecurringCharge: [
{
chargeType: 123,
graduatedAmounts: [{endValue: 123, flatAmount: 123, perAmount: 123, startValue: 123}],
metricId: 123,
standardAmount: 123,
standardStartValue: 123
}
],
multiCurrencies: [
{
amount: 123,
autoExchange: true,
currency: '<string>',
disable: true,
exchangeRate: 123,
fixedAmount: 123
}
],
multiTrials: [
{
intervalCount: 123,
intervalUnit: '<string>',
metadata: {},
name: '<string>',
trialCompareAtPrice: 123,
trialDuration: 123,
trialPrice: 123
}
],
onetimeAddonIds: [123],
productDescription: '<string>',
productId: 123,
productName: '<string>',
tagIds: [123],
trialAmount: 123,
trialDemand: '<string>',
trialDurationTime: 123,
type: 1,
usVATConfig: {
active: true,
fromAddress: {
address: '<string>',
city: '<string>',
countryCode: '<string>',
state: '<string>',
verified: true,
zipCode: '<string>'
},
nexusAddresses: [
{
address: '<string>',
city: '<string>',
countryCode: '<string>',
state: '<string>',
verified: true,
zipCode: '<string>'
}
],
sellOnUSOnly: true,
taxCode: '<string>',
toAddress: {
address: '<string>',
city: '<string>',
countryCode: '<string>',
state: '<string>',
verified: true,
zipCode: '<string>'
}
}
})
};
fetch('https://api.unibee.dev/merchant/plan/new', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.unibee.dev/merchant/plan/new",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 123,
'currency' => '<string>',
'planName' => '<string>',
'addonIds' => [
123
],
'autoChargeConfig' => [
'autoChargeLeadTime' => 123,
'autoChargeMaxRetryCount' => 123,
'autoChargeRetryInterval' => 123,
'incompleteExpireTime' => 123
],
'autoUpgradePlanId' => 123,
'cancelAtTrialEnd' => 123,
'checkoutTemplateId' => 123,
'compareAtAmount' => 123,
'description' => '<string>',
'disableAutoCharge' => 123,
'externalPlanId' => '<string>',
'gasPayer' => '<string>',
'homeUrl' => '<string>',
'imageUrl' => '<string>',
'internalName' => '<string>',
'intervalCount' => 123,
'intervalUnit' => '<string>',
'metadata' => [
],
'metricLimits' => [
[
'metricId' => 123,
'metricLimit' => 123
]
],
'metricMeteredCharge' => [
[
'chargeType' => 123,
'graduatedAmounts' => [
[
'endValue' => 123,
'flatAmount' => 123,
'perAmount' => 123,
'startValue' => 123
]
],
'metricId' => 123,
'standardAmount' => 123,
'standardStartValue' => 123
]
],
'metricRecurringCharge' => [
[
'chargeType' => 123,
'graduatedAmounts' => [
[
'endValue' => 123,
'flatAmount' => 123,
'perAmount' => 123,
'startValue' => 123
]
],
'metricId' => 123,
'standardAmount' => 123,
'standardStartValue' => 123
]
],
'multiCurrencies' => [
[
'amount' => 123,
'autoExchange' => true,
'currency' => '<string>',
'disable' => true,
'exchangeRate' => 123,
'fixedAmount' => 123
]
],
'multiTrials' => [
[
'intervalCount' => 123,
'intervalUnit' => '<string>',
'metadata' => [
],
'name' => '<string>',
'trialCompareAtPrice' => 123,
'trialDuration' => 123,
'trialPrice' => 123
]
],
'onetimeAddonIds' => [
123
],
'productDescription' => '<string>',
'productId' => 123,
'productName' => '<string>',
'tagIds' => [
123
],
'trialAmount' => 123,
'trialDemand' => '<string>',
'trialDurationTime' => 123,
'type' => 1,
'usVATConfig' => [
'active' => true,
'fromAddress' => [
'address' => '<string>',
'city' => '<string>',
'countryCode' => '<string>',
'state' => '<string>',
'verified' => true,
'zipCode' => '<string>'
],
'nexusAddresses' => [
[
'address' => '<string>',
'city' => '<string>',
'countryCode' => '<string>',
'state' => '<string>',
'verified' => true,
'zipCode' => '<string>'
]
],
'sellOnUSOnly' => true,
'taxCode' => '<string>',
'toAddress' => [
'address' => '<string>',
'city' => '<string>',
'countryCode' => '<string>',
'state' => '<string>',
'verified' => true,
'zipCode' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.unibee.dev/merchant/plan/new"
payload := strings.NewReader("{\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"planName\": \"<string>\",\n \"addonIds\": [\n 123\n ],\n \"autoChargeConfig\": {\n \"autoChargeLeadTime\": 123,\n \"autoChargeMaxRetryCount\": 123,\n \"autoChargeRetryInterval\": 123,\n \"incompleteExpireTime\": 123\n },\n \"autoUpgradePlanId\": 123,\n \"cancelAtTrialEnd\": 123,\n \"checkoutTemplateId\": 123,\n \"compareAtAmount\": 123,\n \"description\": \"<string>\",\n \"disableAutoCharge\": 123,\n \"externalPlanId\": \"<string>\",\n \"gasPayer\": \"<string>\",\n \"homeUrl\": \"<string>\",\n \"imageUrl\": \"<string>\",\n \"internalName\": \"<string>\",\n \"intervalCount\": 123,\n \"intervalUnit\": \"<string>\",\n \"metadata\": {},\n \"metricLimits\": [\n {\n \"metricId\": 123,\n \"metricLimit\": 123\n }\n ],\n \"metricMeteredCharge\": [\n {\n \"chargeType\": 123,\n \"graduatedAmounts\": [\n {\n \"endValue\": 123,\n \"flatAmount\": 123,\n \"perAmount\": 123,\n \"startValue\": 123\n }\n ],\n \"metricId\": 123,\n \"standardAmount\": 123,\n \"standardStartValue\": 123\n }\n ],\n \"metricRecurringCharge\": [\n {\n \"chargeType\": 123,\n \"graduatedAmounts\": [\n {\n \"endValue\": 123,\n \"flatAmount\": 123,\n \"perAmount\": 123,\n \"startValue\": 123\n }\n ],\n \"metricId\": 123,\n \"standardAmount\": 123,\n \"standardStartValue\": 123\n }\n ],\n \"multiCurrencies\": [\n {\n \"amount\": 123,\n \"autoExchange\": true,\n \"currency\": \"<string>\",\n \"disable\": true,\n \"exchangeRate\": 123,\n \"fixedAmount\": 123\n }\n ],\n \"multiTrials\": [\n {\n \"intervalCount\": 123,\n \"intervalUnit\": \"<string>\",\n \"metadata\": {},\n \"name\": \"<string>\",\n \"trialCompareAtPrice\": 123,\n \"trialDuration\": 123,\n \"trialPrice\": 123\n }\n ],\n \"onetimeAddonIds\": [\n 123\n ],\n \"productDescription\": \"<string>\",\n \"productId\": 123,\n \"productName\": \"<string>\",\n \"tagIds\": [\n 123\n ],\n \"trialAmount\": 123,\n \"trialDemand\": \"<string>\",\n \"trialDurationTime\": 123,\n \"type\": 1,\n \"usVATConfig\": {\n \"active\": true,\n \"fromAddress\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"state\": \"<string>\",\n \"verified\": true,\n \"zipCode\": \"<string>\"\n },\n \"nexusAddresses\": [\n {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"state\": \"<string>\",\n \"verified\": true,\n \"zipCode\": \"<string>\"\n }\n ],\n \"sellOnUSOnly\": true,\n \"taxCode\": \"<string>\",\n \"toAddress\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"state\": \"<string>\",\n \"verified\": true,\n \"zipCode\": \"<string>\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.unibee.dev/merchant/plan/new")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"planName\": \"<string>\",\n \"addonIds\": [\n 123\n ],\n \"autoChargeConfig\": {\n \"autoChargeLeadTime\": 123,\n \"autoChargeMaxRetryCount\": 123,\n \"autoChargeRetryInterval\": 123,\n \"incompleteExpireTime\": 123\n },\n \"autoUpgradePlanId\": 123,\n \"cancelAtTrialEnd\": 123,\n \"checkoutTemplateId\": 123,\n \"compareAtAmount\": 123,\n \"description\": \"<string>\",\n \"disableAutoCharge\": 123,\n \"externalPlanId\": \"<string>\",\n \"gasPayer\": \"<string>\",\n \"homeUrl\": \"<string>\",\n \"imageUrl\": \"<string>\",\n \"internalName\": \"<string>\",\n \"intervalCount\": 123,\n \"intervalUnit\": \"<string>\",\n \"metadata\": {},\n \"metricLimits\": [\n {\n \"metricId\": 123,\n \"metricLimit\": 123\n }\n ],\n \"metricMeteredCharge\": [\n {\n \"chargeType\": 123,\n \"graduatedAmounts\": [\n {\n \"endValue\": 123,\n \"flatAmount\": 123,\n \"perAmount\": 123,\n \"startValue\": 123\n }\n ],\n \"metricId\": 123,\n \"standardAmount\": 123,\n \"standardStartValue\": 123\n }\n ],\n \"metricRecurringCharge\": [\n {\n \"chargeType\": 123,\n \"graduatedAmounts\": [\n {\n \"endValue\": 123,\n \"flatAmount\": 123,\n \"perAmount\": 123,\n \"startValue\": 123\n }\n ],\n \"metricId\": 123,\n \"standardAmount\": 123,\n \"standardStartValue\": 123\n }\n ],\n \"multiCurrencies\": [\n {\n \"amount\": 123,\n \"autoExchange\": true,\n \"currency\": \"<string>\",\n \"disable\": true,\n \"exchangeRate\": 123,\n \"fixedAmount\": 123\n }\n ],\n \"multiTrials\": [\n {\n \"intervalCount\": 123,\n \"intervalUnit\": \"<string>\",\n \"metadata\": {},\n \"name\": \"<string>\",\n \"trialCompareAtPrice\": 123,\n \"trialDuration\": 123,\n \"trialPrice\": 123\n }\n ],\n \"onetimeAddonIds\": [\n 123\n ],\n \"productDescription\": \"<string>\",\n \"productId\": 123,\n \"productName\": \"<string>\",\n \"tagIds\": [\n 123\n ],\n \"trialAmount\": 123,\n \"trialDemand\": \"<string>\",\n \"trialDurationTime\": 123,\n \"type\": 1,\n \"usVATConfig\": {\n \"active\": true,\n \"fromAddress\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"state\": \"<string>\",\n \"verified\": true,\n \"zipCode\": \"<string>\"\n },\n \"nexusAddresses\": [\n {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"state\": \"<string>\",\n \"verified\": true,\n \"zipCode\": \"<string>\"\n }\n ],\n \"sellOnUSOnly\": true,\n \"taxCode\": \"<string>\",\n \"toAddress\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"state\": \"<string>\",\n \"verified\": true,\n \"zipCode\": \"<string>\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.unibee.dev/merchant/plan/new")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"planName\": \"<string>\",\n \"addonIds\": [\n 123\n ],\n \"autoChargeConfig\": {\n \"autoChargeLeadTime\": 123,\n \"autoChargeMaxRetryCount\": 123,\n \"autoChargeRetryInterval\": 123,\n \"incompleteExpireTime\": 123\n },\n \"autoUpgradePlanId\": 123,\n \"cancelAtTrialEnd\": 123,\n \"checkoutTemplateId\": 123,\n \"compareAtAmount\": 123,\n \"description\": \"<string>\",\n \"disableAutoCharge\": 123,\n \"externalPlanId\": \"<string>\",\n \"gasPayer\": \"<string>\",\n \"homeUrl\": \"<string>\",\n \"imageUrl\": \"<string>\",\n \"internalName\": \"<string>\",\n \"intervalCount\": 123,\n \"intervalUnit\": \"<string>\",\n \"metadata\": {},\n \"metricLimits\": [\n {\n \"metricId\": 123,\n \"metricLimit\": 123\n }\n ],\n \"metricMeteredCharge\": [\n {\n \"chargeType\": 123,\n \"graduatedAmounts\": [\n {\n \"endValue\": 123,\n \"flatAmount\": 123,\n \"perAmount\": 123,\n \"startValue\": 123\n }\n ],\n \"metricId\": 123,\n \"standardAmount\": 123,\n \"standardStartValue\": 123\n }\n ],\n \"metricRecurringCharge\": [\n {\n \"chargeType\": 123,\n \"graduatedAmounts\": [\n {\n \"endValue\": 123,\n \"flatAmount\": 123,\n \"perAmount\": 123,\n \"startValue\": 123\n }\n ],\n \"metricId\": 123,\n \"standardAmount\": 123,\n \"standardStartValue\": 123\n }\n ],\n \"multiCurrencies\": [\n {\n \"amount\": 123,\n \"autoExchange\": true,\n \"currency\": \"<string>\",\n \"disable\": true,\n \"exchangeRate\": 123,\n \"fixedAmount\": 123\n }\n ],\n \"multiTrials\": [\n {\n \"intervalCount\": 123,\n \"intervalUnit\": \"<string>\",\n \"metadata\": {},\n \"name\": \"<string>\",\n \"trialCompareAtPrice\": 123,\n \"trialDuration\": 123,\n \"trialPrice\": 123\n }\n ],\n \"onetimeAddonIds\": [\n 123\n ],\n \"productDescription\": \"<string>\",\n \"productId\": 123,\n \"productName\": \"<string>\",\n \"tagIds\": [\n 123\n ],\n \"trialAmount\": 123,\n \"trialDemand\": \"<string>\",\n \"trialDurationTime\": 123,\n \"type\": 1,\n \"usVATConfig\": {\n \"active\": true,\n \"fromAddress\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"state\": \"<string>\",\n \"verified\": true,\n \"zipCode\": \"<string>\"\n },\n \"nexusAddresses\": [\n {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"state\": \"<string>\",\n \"verified\": true,\n \"zipCode\": \"<string>\"\n }\n ],\n \"sellOnUSOnly\": true,\n \"taxCode\": \"<string>\",\n \"toAddress\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"state\": \"<string>\",\n \"verified\": true,\n \"zipCode\": \"<string>\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 123,
"data": {
"plan": {
"amount": 123,
"autoChargeConfig": {
"autoChargeLeadTime": 123,
"autoChargeMaxRetryCount": 123,
"autoChargeRetryInterval": 123,
"incompleteExpireTime": 123
},
"autoUpgradePlanId": 123,
"bindingAddonIds": "<string>",
"bindingOnetimeAddonIds": "<string>",
"cancelAtTrialEnd": 123,
"checkoutTemplateId": 123,
"checkoutUrl": "<string>",
"compareAtAmount": 123,
"createTime": 123,
"currency": "<string>",
"description": "<string>",
"disableAutoCharge": 123,
"externalPlanId": "<string>",
"extraMetricData": "<string>",
"gasPayer": "<string>",
"homeUrl": "<string>",
"id": 123,
"imageUrl": "<string>",
"internalName": "<string>",
"intervalCount": 123,
"intervalUnit": "<string>",
"merchantId": 123,
"metadata": {},
"metricLimits": [
{
"metricId": 123,
"metricLimit": 123
}
],
"metricMeteredCharge": [
{
"chargeType": 123,
"graduatedAmounts": [
{
"endValue": 123,
"flatAmount": 123,
"perAmount": 123,
"startValue": 123
}
],
"metricId": 123,
"standardAmount": 123,
"standardStartValue": 123
}
],
"metricRecurringCharge": [
{
"chargeType": 123,
"graduatedAmounts": [
{
"endValue": 123,
"flatAmount": 123,
"perAmount": 123,
"startValue": 123
}
],
"metricId": 123,
"standardAmount": 123,
"standardStartValue": 123
}
],
"multiCurrencies": [
{
"amount": 123,
"autoExchange": true,
"currency": "<string>",
"disable": true,
"exchangeRate": 123,
"fixedAmount": 123
}
],
"multiTrials": [
{
"intervalCount": 123,
"intervalUnit": "<string>",
"metadata": {},
"name": "<string>",
"trialCompareAtPrice": 123,
"trialDuration": 123,
"trialPrice": 123
}
],
"planName": "<string>",
"productId": 123,
"publishStatus": 123,
"status": 123,
"taxPercentage": 123,
"trialAmount": 123,
"trialDemand": "<string>",
"trialDurationTime": 123,
"type": 123,
"usVATConfig": {
"active": true,
"fromAddress": {
"address": "<string>",
"city": "<string>",
"countryCode": "<string>",
"state": "<string>",
"verified": true,
"zipCode": "<string>"
},
"nexusAddresses": [
{
"address": "<string>",
"city": "<string>",
"countryCode": "<string>",
"state": "<string>",
"verified": true,
"zipCode": "<string>"
}
],
"sellOnUSOnly": true,
"taxCode": "<string>",
"toAddress": {
"address": "<string>",
"city": "<string>",
"countryCode": "<string>",
"state": "<string>",
"verified": true,
"zipCode": "<string>"
}
}
},
"tags": [
{
"bindingCount": 123,
"color": "<string>",
"description": "<string>",
"id": 123,
"merchantId": 123,
"name": "<string>",
"scope": 123,
"sortOrder": 123
}
]
},
"merchantId": 123,
"message": "<string>",
"redirect": "<string>",
"requestId": "<string>"
}Create Plan
curl --request POST \
--url https://api.unibee.dev/merchant/plan/new \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 123,
"currency": "<string>",
"planName": "<string>",
"addonIds": [
123
],
"autoChargeConfig": {
"autoChargeLeadTime": 123,
"autoChargeMaxRetryCount": 123,
"autoChargeRetryInterval": 123,
"incompleteExpireTime": 123
},
"autoUpgradePlanId": 123,
"cancelAtTrialEnd": 123,
"checkoutTemplateId": 123,
"compareAtAmount": 123,
"description": "<string>",
"disableAutoCharge": 123,
"externalPlanId": "<string>",
"gasPayer": "<string>",
"homeUrl": "<string>",
"imageUrl": "<string>",
"internalName": "<string>",
"intervalCount": 123,
"intervalUnit": "<string>",
"metadata": {},
"metricLimits": [
{
"metricId": 123,
"metricLimit": 123
}
],
"metricMeteredCharge": [
{
"chargeType": 123,
"graduatedAmounts": [
{
"endValue": 123,
"flatAmount": 123,
"perAmount": 123,
"startValue": 123
}
],
"metricId": 123,
"standardAmount": 123,
"standardStartValue": 123
}
],
"metricRecurringCharge": [
{
"chargeType": 123,
"graduatedAmounts": [
{
"endValue": 123,
"flatAmount": 123,
"perAmount": 123,
"startValue": 123
}
],
"metricId": 123,
"standardAmount": 123,
"standardStartValue": 123
}
],
"multiCurrencies": [
{
"amount": 123,
"autoExchange": true,
"currency": "<string>",
"disable": true,
"exchangeRate": 123,
"fixedAmount": 123
}
],
"multiTrials": [
{
"intervalCount": 123,
"intervalUnit": "<string>",
"metadata": {},
"name": "<string>",
"trialCompareAtPrice": 123,
"trialDuration": 123,
"trialPrice": 123
}
],
"onetimeAddonIds": [
123
],
"productDescription": "<string>",
"productId": 123,
"productName": "<string>",
"tagIds": [
123
],
"trialAmount": 123,
"trialDemand": "<string>",
"trialDurationTime": 123,
"type": 1,
"usVATConfig": {
"active": true,
"fromAddress": {
"address": "<string>",
"city": "<string>",
"countryCode": "<string>",
"state": "<string>",
"verified": true,
"zipCode": "<string>"
},
"nexusAddresses": [
{
"address": "<string>",
"city": "<string>",
"countryCode": "<string>",
"state": "<string>",
"verified": true,
"zipCode": "<string>"
}
],
"sellOnUSOnly": true,
"taxCode": "<string>",
"toAddress": {
"address": "<string>",
"city": "<string>",
"countryCode": "<string>",
"state": "<string>",
"verified": true,
"zipCode": "<string>"
}
}
}
'import requests
url = "https://api.unibee.dev/merchant/plan/new"
payload = {
"amount": 123,
"currency": "<string>",
"planName": "<string>",
"addonIds": [123],
"autoChargeConfig": {
"autoChargeLeadTime": 123,
"autoChargeMaxRetryCount": 123,
"autoChargeRetryInterval": 123,
"incompleteExpireTime": 123
},
"autoUpgradePlanId": 123,
"cancelAtTrialEnd": 123,
"checkoutTemplateId": 123,
"compareAtAmount": 123,
"description": "<string>",
"disableAutoCharge": 123,
"externalPlanId": "<string>",
"gasPayer": "<string>",
"homeUrl": "<string>",
"imageUrl": "<string>",
"internalName": "<string>",
"intervalCount": 123,
"intervalUnit": "<string>",
"metadata": {},
"metricLimits": [
{
"metricId": 123,
"metricLimit": 123
}
],
"metricMeteredCharge": [
{
"chargeType": 123,
"graduatedAmounts": [
{
"endValue": 123,
"flatAmount": 123,
"perAmount": 123,
"startValue": 123
}
],
"metricId": 123,
"standardAmount": 123,
"standardStartValue": 123
}
],
"metricRecurringCharge": [
{
"chargeType": 123,
"graduatedAmounts": [
{
"endValue": 123,
"flatAmount": 123,
"perAmount": 123,
"startValue": 123
}
],
"metricId": 123,
"standardAmount": 123,
"standardStartValue": 123
}
],
"multiCurrencies": [
{
"amount": 123,
"autoExchange": True,
"currency": "<string>",
"disable": True,
"exchangeRate": 123,
"fixedAmount": 123
}
],
"multiTrials": [
{
"intervalCount": 123,
"intervalUnit": "<string>",
"metadata": {},
"name": "<string>",
"trialCompareAtPrice": 123,
"trialDuration": 123,
"trialPrice": 123
}
],
"onetimeAddonIds": [123],
"productDescription": "<string>",
"productId": 123,
"productName": "<string>",
"tagIds": [123],
"trialAmount": 123,
"trialDemand": "<string>",
"trialDurationTime": 123,
"type": 1,
"usVATConfig": {
"active": True,
"fromAddress": {
"address": "<string>",
"city": "<string>",
"countryCode": "<string>",
"state": "<string>",
"verified": True,
"zipCode": "<string>"
},
"nexusAddresses": [
{
"address": "<string>",
"city": "<string>",
"countryCode": "<string>",
"state": "<string>",
"verified": True,
"zipCode": "<string>"
}
],
"sellOnUSOnly": True,
"taxCode": "<string>",
"toAddress": {
"address": "<string>",
"city": "<string>",
"countryCode": "<string>",
"state": "<string>",
"verified": True,
"zipCode": "<string>"
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 123,
currency: '<string>',
planName: '<string>',
addonIds: [123],
autoChargeConfig: {
autoChargeLeadTime: 123,
autoChargeMaxRetryCount: 123,
autoChargeRetryInterval: 123,
incompleteExpireTime: 123
},
autoUpgradePlanId: 123,
cancelAtTrialEnd: 123,
checkoutTemplateId: 123,
compareAtAmount: 123,
description: '<string>',
disableAutoCharge: 123,
externalPlanId: '<string>',
gasPayer: '<string>',
homeUrl: '<string>',
imageUrl: '<string>',
internalName: '<string>',
intervalCount: 123,
intervalUnit: '<string>',
metadata: {},
metricLimits: [{metricId: 123, metricLimit: 123}],
metricMeteredCharge: [
{
chargeType: 123,
graduatedAmounts: [{endValue: 123, flatAmount: 123, perAmount: 123, startValue: 123}],
metricId: 123,
standardAmount: 123,
standardStartValue: 123
}
],
metricRecurringCharge: [
{
chargeType: 123,
graduatedAmounts: [{endValue: 123, flatAmount: 123, perAmount: 123, startValue: 123}],
metricId: 123,
standardAmount: 123,
standardStartValue: 123
}
],
multiCurrencies: [
{
amount: 123,
autoExchange: true,
currency: '<string>',
disable: true,
exchangeRate: 123,
fixedAmount: 123
}
],
multiTrials: [
{
intervalCount: 123,
intervalUnit: '<string>',
metadata: {},
name: '<string>',
trialCompareAtPrice: 123,
trialDuration: 123,
trialPrice: 123
}
],
onetimeAddonIds: [123],
productDescription: '<string>',
productId: 123,
productName: '<string>',
tagIds: [123],
trialAmount: 123,
trialDemand: '<string>',
trialDurationTime: 123,
type: 1,
usVATConfig: {
active: true,
fromAddress: {
address: '<string>',
city: '<string>',
countryCode: '<string>',
state: '<string>',
verified: true,
zipCode: '<string>'
},
nexusAddresses: [
{
address: '<string>',
city: '<string>',
countryCode: '<string>',
state: '<string>',
verified: true,
zipCode: '<string>'
}
],
sellOnUSOnly: true,
taxCode: '<string>',
toAddress: {
address: '<string>',
city: '<string>',
countryCode: '<string>',
state: '<string>',
verified: true,
zipCode: '<string>'
}
}
})
};
fetch('https://api.unibee.dev/merchant/plan/new', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.unibee.dev/merchant/plan/new",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 123,
'currency' => '<string>',
'planName' => '<string>',
'addonIds' => [
123
],
'autoChargeConfig' => [
'autoChargeLeadTime' => 123,
'autoChargeMaxRetryCount' => 123,
'autoChargeRetryInterval' => 123,
'incompleteExpireTime' => 123
],
'autoUpgradePlanId' => 123,
'cancelAtTrialEnd' => 123,
'checkoutTemplateId' => 123,
'compareAtAmount' => 123,
'description' => '<string>',
'disableAutoCharge' => 123,
'externalPlanId' => '<string>',
'gasPayer' => '<string>',
'homeUrl' => '<string>',
'imageUrl' => '<string>',
'internalName' => '<string>',
'intervalCount' => 123,
'intervalUnit' => '<string>',
'metadata' => [
],
'metricLimits' => [
[
'metricId' => 123,
'metricLimit' => 123
]
],
'metricMeteredCharge' => [
[
'chargeType' => 123,
'graduatedAmounts' => [
[
'endValue' => 123,
'flatAmount' => 123,
'perAmount' => 123,
'startValue' => 123
]
],
'metricId' => 123,
'standardAmount' => 123,
'standardStartValue' => 123
]
],
'metricRecurringCharge' => [
[
'chargeType' => 123,
'graduatedAmounts' => [
[
'endValue' => 123,
'flatAmount' => 123,
'perAmount' => 123,
'startValue' => 123
]
],
'metricId' => 123,
'standardAmount' => 123,
'standardStartValue' => 123
]
],
'multiCurrencies' => [
[
'amount' => 123,
'autoExchange' => true,
'currency' => '<string>',
'disable' => true,
'exchangeRate' => 123,
'fixedAmount' => 123
]
],
'multiTrials' => [
[
'intervalCount' => 123,
'intervalUnit' => '<string>',
'metadata' => [
],
'name' => '<string>',
'trialCompareAtPrice' => 123,
'trialDuration' => 123,
'trialPrice' => 123
]
],
'onetimeAddonIds' => [
123
],
'productDescription' => '<string>',
'productId' => 123,
'productName' => '<string>',
'tagIds' => [
123
],
'trialAmount' => 123,
'trialDemand' => '<string>',
'trialDurationTime' => 123,
'type' => 1,
'usVATConfig' => [
'active' => true,
'fromAddress' => [
'address' => '<string>',
'city' => '<string>',
'countryCode' => '<string>',
'state' => '<string>',
'verified' => true,
'zipCode' => '<string>'
],
'nexusAddresses' => [
[
'address' => '<string>',
'city' => '<string>',
'countryCode' => '<string>',
'state' => '<string>',
'verified' => true,
'zipCode' => '<string>'
]
],
'sellOnUSOnly' => true,
'taxCode' => '<string>',
'toAddress' => [
'address' => '<string>',
'city' => '<string>',
'countryCode' => '<string>',
'state' => '<string>',
'verified' => true,
'zipCode' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.unibee.dev/merchant/plan/new"
payload := strings.NewReader("{\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"planName\": \"<string>\",\n \"addonIds\": [\n 123\n ],\n \"autoChargeConfig\": {\n \"autoChargeLeadTime\": 123,\n \"autoChargeMaxRetryCount\": 123,\n \"autoChargeRetryInterval\": 123,\n \"incompleteExpireTime\": 123\n },\n \"autoUpgradePlanId\": 123,\n \"cancelAtTrialEnd\": 123,\n \"checkoutTemplateId\": 123,\n \"compareAtAmount\": 123,\n \"description\": \"<string>\",\n \"disableAutoCharge\": 123,\n \"externalPlanId\": \"<string>\",\n \"gasPayer\": \"<string>\",\n \"homeUrl\": \"<string>\",\n \"imageUrl\": \"<string>\",\n \"internalName\": \"<string>\",\n \"intervalCount\": 123,\n \"intervalUnit\": \"<string>\",\n \"metadata\": {},\n \"metricLimits\": [\n {\n \"metricId\": 123,\n \"metricLimit\": 123\n }\n ],\n \"metricMeteredCharge\": [\n {\n \"chargeType\": 123,\n \"graduatedAmounts\": [\n {\n \"endValue\": 123,\n \"flatAmount\": 123,\n \"perAmount\": 123,\n \"startValue\": 123\n }\n ],\n \"metricId\": 123,\n \"standardAmount\": 123,\n \"standardStartValue\": 123\n }\n ],\n \"metricRecurringCharge\": [\n {\n \"chargeType\": 123,\n \"graduatedAmounts\": [\n {\n \"endValue\": 123,\n \"flatAmount\": 123,\n \"perAmount\": 123,\n \"startValue\": 123\n }\n ],\n \"metricId\": 123,\n \"standardAmount\": 123,\n \"standardStartValue\": 123\n }\n ],\n \"multiCurrencies\": [\n {\n \"amount\": 123,\n \"autoExchange\": true,\n \"currency\": \"<string>\",\n \"disable\": true,\n \"exchangeRate\": 123,\n \"fixedAmount\": 123\n }\n ],\n \"multiTrials\": [\n {\n \"intervalCount\": 123,\n \"intervalUnit\": \"<string>\",\n \"metadata\": {},\n \"name\": \"<string>\",\n \"trialCompareAtPrice\": 123,\n \"trialDuration\": 123,\n \"trialPrice\": 123\n }\n ],\n \"onetimeAddonIds\": [\n 123\n ],\n \"productDescription\": \"<string>\",\n \"productId\": 123,\n \"productName\": \"<string>\",\n \"tagIds\": [\n 123\n ],\n \"trialAmount\": 123,\n \"trialDemand\": \"<string>\",\n \"trialDurationTime\": 123,\n \"type\": 1,\n \"usVATConfig\": {\n \"active\": true,\n \"fromAddress\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"state\": \"<string>\",\n \"verified\": true,\n \"zipCode\": \"<string>\"\n },\n \"nexusAddresses\": [\n {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"state\": \"<string>\",\n \"verified\": true,\n \"zipCode\": \"<string>\"\n }\n ],\n \"sellOnUSOnly\": true,\n \"taxCode\": \"<string>\",\n \"toAddress\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"state\": \"<string>\",\n \"verified\": true,\n \"zipCode\": \"<string>\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.unibee.dev/merchant/plan/new")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"planName\": \"<string>\",\n \"addonIds\": [\n 123\n ],\n \"autoChargeConfig\": {\n \"autoChargeLeadTime\": 123,\n \"autoChargeMaxRetryCount\": 123,\n \"autoChargeRetryInterval\": 123,\n \"incompleteExpireTime\": 123\n },\n \"autoUpgradePlanId\": 123,\n \"cancelAtTrialEnd\": 123,\n \"checkoutTemplateId\": 123,\n \"compareAtAmount\": 123,\n \"description\": \"<string>\",\n \"disableAutoCharge\": 123,\n \"externalPlanId\": \"<string>\",\n \"gasPayer\": \"<string>\",\n \"homeUrl\": \"<string>\",\n \"imageUrl\": \"<string>\",\n \"internalName\": \"<string>\",\n \"intervalCount\": 123,\n \"intervalUnit\": \"<string>\",\n \"metadata\": {},\n \"metricLimits\": [\n {\n \"metricId\": 123,\n \"metricLimit\": 123\n }\n ],\n \"metricMeteredCharge\": [\n {\n \"chargeType\": 123,\n \"graduatedAmounts\": [\n {\n \"endValue\": 123,\n \"flatAmount\": 123,\n \"perAmount\": 123,\n \"startValue\": 123\n }\n ],\n \"metricId\": 123,\n \"standardAmount\": 123,\n \"standardStartValue\": 123\n }\n ],\n \"metricRecurringCharge\": [\n {\n \"chargeType\": 123,\n \"graduatedAmounts\": [\n {\n \"endValue\": 123,\n \"flatAmount\": 123,\n \"perAmount\": 123,\n \"startValue\": 123\n }\n ],\n \"metricId\": 123,\n \"standardAmount\": 123,\n \"standardStartValue\": 123\n }\n ],\n \"multiCurrencies\": [\n {\n \"amount\": 123,\n \"autoExchange\": true,\n \"currency\": \"<string>\",\n \"disable\": true,\n \"exchangeRate\": 123,\n \"fixedAmount\": 123\n }\n ],\n \"multiTrials\": [\n {\n \"intervalCount\": 123,\n \"intervalUnit\": \"<string>\",\n \"metadata\": {},\n \"name\": \"<string>\",\n \"trialCompareAtPrice\": 123,\n \"trialDuration\": 123,\n \"trialPrice\": 123\n }\n ],\n \"onetimeAddonIds\": [\n 123\n ],\n \"productDescription\": \"<string>\",\n \"productId\": 123,\n \"productName\": \"<string>\",\n \"tagIds\": [\n 123\n ],\n \"trialAmount\": 123,\n \"trialDemand\": \"<string>\",\n \"trialDurationTime\": 123,\n \"type\": 1,\n \"usVATConfig\": {\n \"active\": true,\n \"fromAddress\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"state\": \"<string>\",\n \"verified\": true,\n \"zipCode\": \"<string>\"\n },\n \"nexusAddresses\": [\n {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"state\": \"<string>\",\n \"verified\": true,\n \"zipCode\": \"<string>\"\n }\n ],\n \"sellOnUSOnly\": true,\n \"taxCode\": \"<string>\",\n \"toAddress\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"state\": \"<string>\",\n \"verified\": true,\n \"zipCode\": \"<string>\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.unibee.dev/merchant/plan/new")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"planName\": \"<string>\",\n \"addonIds\": [\n 123\n ],\n \"autoChargeConfig\": {\n \"autoChargeLeadTime\": 123,\n \"autoChargeMaxRetryCount\": 123,\n \"autoChargeRetryInterval\": 123,\n \"incompleteExpireTime\": 123\n },\n \"autoUpgradePlanId\": 123,\n \"cancelAtTrialEnd\": 123,\n \"checkoutTemplateId\": 123,\n \"compareAtAmount\": 123,\n \"description\": \"<string>\",\n \"disableAutoCharge\": 123,\n \"externalPlanId\": \"<string>\",\n \"gasPayer\": \"<string>\",\n \"homeUrl\": \"<string>\",\n \"imageUrl\": \"<string>\",\n \"internalName\": \"<string>\",\n \"intervalCount\": 123,\n \"intervalUnit\": \"<string>\",\n \"metadata\": {},\n \"metricLimits\": [\n {\n \"metricId\": 123,\n \"metricLimit\": 123\n }\n ],\n \"metricMeteredCharge\": [\n {\n \"chargeType\": 123,\n \"graduatedAmounts\": [\n {\n \"endValue\": 123,\n \"flatAmount\": 123,\n \"perAmount\": 123,\n \"startValue\": 123\n }\n ],\n \"metricId\": 123,\n \"standardAmount\": 123,\n \"standardStartValue\": 123\n }\n ],\n \"metricRecurringCharge\": [\n {\n \"chargeType\": 123,\n \"graduatedAmounts\": [\n {\n \"endValue\": 123,\n \"flatAmount\": 123,\n \"perAmount\": 123,\n \"startValue\": 123\n }\n ],\n \"metricId\": 123,\n \"standardAmount\": 123,\n \"standardStartValue\": 123\n }\n ],\n \"multiCurrencies\": [\n {\n \"amount\": 123,\n \"autoExchange\": true,\n \"currency\": \"<string>\",\n \"disable\": true,\n \"exchangeRate\": 123,\n \"fixedAmount\": 123\n }\n ],\n \"multiTrials\": [\n {\n \"intervalCount\": 123,\n \"intervalUnit\": \"<string>\",\n \"metadata\": {},\n \"name\": \"<string>\",\n \"trialCompareAtPrice\": 123,\n \"trialDuration\": 123,\n \"trialPrice\": 123\n }\n ],\n \"onetimeAddonIds\": [\n 123\n ],\n \"productDescription\": \"<string>\",\n \"productId\": 123,\n \"productName\": \"<string>\",\n \"tagIds\": [\n 123\n ],\n \"trialAmount\": 123,\n \"trialDemand\": \"<string>\",\n \"trialDurationTime\": 123,\n \"type\": 1,\n \"usVATConfig\": {\n \"active\": true,\n \"fromAddress\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"state\": \"<string>\",\n \"verified\": true,\n \"zipCode\": \"<string>\"\n },\n \"nexusAddresses\": [\n {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"state\": \"<string>\",\n \"verified\": true,\n \"zipCode\": \"<string>\"\n }\n ],\n \"sellOnUSOnly\": true,\n \"taxCode\": \"<string>\",\n \"toAddress\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"state\": \"<string>\",\n \"verified\": true,\n \"zipCode\": \"<string>\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 123,
"data": {
"plan": {
"amount": 123,
"autoChargeConfig": {
"autoChargeLeadTime": 123,
"autoChargeMaxRetryCount": 123,
"autoChargeRetryInterval": 123,
"incompleteExpireTime": 123
},
"autoUpgradePlanId": 123,
"bindingAddonIds": "<string>",
"bindingOnetimeAddonIds": "<string>",
"cancelAtTrialEnd": 123,
"checkoutTemplateId": 123,
"checkoutUrl": "<string>",
"compareAtAmount": 123,
"createTime": 123,
"currency": "<string>",
"description": "<string>",
"disableAutoCharge": 123,
"externalPlanId": "<string>",
"extraMetricData": "<string>",
"gasPayer": "<string>",
"homeUrl": "<string>",
"id": 123,
"imageUrl": "<string>",
"internalName": "<string>",
"intervalCount": 123,
"intervalUnit": "<string>",
"merchantId": 123,
"metadata": {},
"metricLimits": [
{
"metricId": 123,
"metricLimit": 123
}
],
"metricMeteredCharge": [
{
"chargeType": 123,
"graduatedAmounts": [
{
"endValue": 123,
"flatAmount": 123,
"perAmount": 123,
"startValue": 123
}
],
"metricId": 123,
"standardAmount": 123,
"standardStartValue": 123
}
],
"metricRecurringCharge": [
{
"chargeType": 123,
"graduatedAmounts": [
{
"endValue": 123,
"flatAmount": 123,
"perAmount": 123,
"startValue": 123
}
],
"metricId": 123,
"standardAmount": 123,
"standardStartValue": 123
}
],
"multiCurrencies": [
{
"amount": 123,
"autoExchange": true,
"currency": "<string>",
"disable": true,
"exchangeRate": 123,
"fixedAmount": 123
}
],
"multiTrials": [
{
"intervalCount": 123,
"intervalUnit": "<string>",
"metadata": {},
"name": "<string>",
"trialCompareAtPrice": 123,
"trialDuration": 123,
"trialPrice": 123
}
],
"planName": "<string>",
"productId": 123,
"publishStatus": 123,
"status": 123,
"taxPercentage": 123,
"trialAmount": 123,
"trialDemand": "<string>",
"trialDurationTime": 123,
"type": 123,
"usVATConfig": {
"active": true,
"fromAddress": {
"address": "<string>",
"city": "<string>",
"countryCode": "<string>",
"state": "<string>",
"verified": true,
"zipCode": "<string>"
},
"nexusAddresses": [
{
"address": "<string>",
"city": "<string>",
"countryCode": "<string>",
"state": "<string>",
"verified": true,
"zipCode": "<string>"
}
],
"sellOnUSOnly": true,
"taxCode": "<string>",
"toAddress": {
"address": "<string>",
"city": "<string>",
"countryCode": "<string>",
"state": "<string>",
"verified": true,
"zipCode": "<string>"
}
}
},
"tags": [
{
"bindingCount": 123,
"color": "<string>",
"description": "<string>",
"id": 123,
"merchantId": 123,
"name": "<string>",
"scope": 123,
"sortOrder": 123
}
]
},
"merchantId": 123,
"message": "<string>",
"redirect": "<string>",
"requestId": "<string>"
}Endpoint Overview
POSThttps://api.unibee.dev/merchant/plan/new
Create Plan
Authorization
All UniBee Merchant API requests require authentication via API key.| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <your_api_key> |
Content-Type | Yes | application/json (for request body) |
Parameters
Parameters for this endpoint are listed below. The schema is also shown in the Try it panel.Request body
| Name | Type | Required | Description |
|---|---|---|---|
addonIds | array | No | Plan Ids Of Recurring Addon Type |
amount | integer | Yes | Plan Amount |
cancelAtTrialEnd | integer | No | whether cancel at subscription first trial end,0-false | 1-true, will pass to cancelAtPeriodEnd of subscription |
currency | string | Yes | Plan Currency |
description | string | No | Description |
externalPlanId | string | No | ExternalPlanId |
gasPayer | string | No | who pay the gas for crypto payment, merchant|user |
homeUrl | string | No | HomeUrl,Start With: http |
imageUrl | string | No | ImageUrl,Start With: http |
internalName | string | No | |
intervalCount | integer | No | Number Of IntervalUnit,em: day|month|year|week |
intervalUnit | string | No | Plan Interval Unit,em: day|month|year|week |
metadata | object | No | Metadata,Map |
metricLimits | array | No | Plan’s MetricLimit List |
metricMeteredCharge | array | No | Plan’s MetricMeteredCharge |
metricRecurringCharge | array | No | Plan’s MetricRecurringCharge |
multiCurrencies | array | No | Plan’s MultiCurrencies |
onetimeAddonIds | array | No | Plan Ids Of Onetime Addon Type |
planName | string | Yes | Plan Name |
productDescription | string | No | Default Copy Description |
productId | integer | No | Id of product which plan to linked |
productName | string | No | Default Copy PlanName |
trialAmount | integer | No | price of trial period, not available for addon |
trialDemand | string | No | demand of trial, not available for addon, example, paymentMethod, payment method will ask for subscription trial start |
trialDurationTime | integer | No | duration of trial, not available for addon |
type | integer | No | The type of plan, 1-main plan,2-addon plan, 3-onetime plan, default main plan |
usVATConfig | string | No |
Request examples
cURL
curl -X POST "https://api.unibee.dev/merchant/plan/new" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"addonIds": [],
"amount": 0,
"cancelAtTrialEnd": 0,
"currency": "",
"description": "",
"externalPlanId": "id_example",
"gasPayer": "",
"homeUrl": "https://example.com",
"imageUrl": "https://example.com",
"internalName": "",
"intervalCount": 0,
"intervalUnit": "",
"metadata": {},
"metricLimits": [],
"metricMeteredCharge": [],
"metricRecurringCharge": [],
"multiCurrencies": [],
"onetimeAddonIds": 0,
"planName": "",
"productDescription": "",
"productId": 0,
"productName": "",
"trialAmount": 0,
"trialDemand": "",
"trialDurationTime": 0,
"type": 0,
"usVATConfig": ""
}'
Sandbox
curl -X POST "https://api-sandbox.unibee.top/merchant/plan/new" \
-H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"addonIds": [],
"amount": 0,
"cancelAtTrialEnd": 0,
"currency": "",
"description": "",
"externalPlanId": "id_example",
"gasPayer": "",
"homeUrl": "https://example.com",
"imageUrl": "https://example.com",
"internalName": "",
"intervalCount": 0,
"intervalUnit": "",
"metadata": {},
"metricLimits": [],
"metricMeteredCharge": [],
"metricRecurringCharge": [],
"multiCurrencies": [],
"onetimeAddonIds": 0,
"planName": "",
"productDescription": "",
"productId": 0,
"productName": "",
"trialAmount": 0,
"trialDemand": "",
"trialDurationTime": 0,
"type": 0,
"usVATConfig": ""
}'
Response
Success responses return a JSON envelope withcode, data, message, redirect, and requestId. code 0 indicates success.
| Field | Type | Description |
|---|---|---|
code | integer | Response code. 0 = success |
data | object | Response payload |
data.plan | object | |
message | string | Human-readable message |
requestId | string | Request ID for support |
Error handling
| 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.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Plan Amount
Plan Currency
Plan Name
Plan Ids Of Recurring Addon Type
Show child attributes
Show child attributes
Target plan id stored in additional settings when >0; independent of disableAutoCharge
whether cancel at subscription first trial end,0-false | 1-true, will pass to cancelAtPeriodEnd of subscription
Checkout template id, used to build checkoutUrl; stored in plan additional settings
optional strikethrough/compare-at price for regular plan amount (minor units, plan currency); UI only; stored in additional settings JSON with multiTrials; omit or 0 to leave unset
Description
Stored: 0=allow subscription auto-charge, 1=disable(single-cycle) — only applies to main recurring plans (type=1) with amount>0. For addon, onetime, or amount 0, you may still send 0/1; responses always return disableAutoCharge 1 and subscriptions never use auto-charge for those plans.
ExternalPlanId
who pay the gas for crypto payment, merchant|user
HomeUrl,Start With: http
ImageUrl,Start With: http
Number Of IntervalUnit,em: day|month|year|week
Plan Interval Unit,em: day|month|year|week
Metadata,Map
Show child attributes
Show child attributes
Plan's MetricLimit List
Show child attributes
Show child attributes
Plan's MetricMeteredCharge
Show child attributes
Show child attributes
Plan's MetricRecurringCharge
Show child attributes
Show child attributes
Plan's MultiCurrencies
Show child attributes
Show child attributes
multi-step trials for this plan; when set, the first item will override trialAmount & trialDurationTime
Show child attributes
Show child attributes
Plan Ids Of Onetime Addon Type
Default Copy Description
Id of product which plan to linked
Default Copy PlanName
Plan tag ids to bind after create. Omit or [] = no tags. Binding is best-effort; retry with edit or batch_tag_bind if needed.
price of trial period, not available for addon; overridden by multiTrials[0].trialPrice when multiTrials is set
demand of trial, not available for addon, example, paymentMethod, payment method will ask for subscription trial start
duration of trial (seconds), not available for addon; overridden by multiTrials[0].trialDuration when multiTrials is set
The type of plan, 1-main plan,2-addon plan, 3-onetime plan, default main plan
Show child attributes
Show child attributes

