curl --request POST \
--url https://api.example.com/api/v1/subscription/change \
--header 'Content-Type: application/json' \
--data '
{
"subscriptionRequest": "<string>",
"originSubscriptionRequest": "ORG_SUB_REQ_001",
"remainingAmount": 50000,
"currency": "USD",
"requestedAt": "2023-11-07T05:31:56Z",
"notifyUrl": "https://merchant.com/notify",
"productInfoList": [
{
"description": "Premium Monthly Subscription",
"periodType": "MONTHLY",
"amount": 100000,
"periodInterval": 1,
"numberOfPeriod": 12,
"trialPeriodAmount": 0,
"numberOfTrialPeriod": 1,
"trialPeriodType": "MONTHLY",
"trialPeriodInterval": 1,
"scheduledAmounts": [
{
"period": "<string>",
"amount": "<string>"
}
]
}
],
"merchantInfo": {
"merchantId": "M0001",
"subMerchantId": "<string>"
},
"userInfo": {
"userId": "USER001",
"userEmail": "user@example.com",
"userTerminal": "<string>",
"userPhone": "+62-08990013157",
"userFirstName": "<string>",
"userLastName": "<string>",
"userCreatedAt": "2023-11-07T05:31:56Z"
},
"goodsInfo": {
"goodsId": "GOODS001",
"goodsName": "Premium Subscription Plan",
"goodsCategory": "<string>",
"goodsUrl": "<string>",
"appName": "<string>",
"skuName": "<string>",
"goodsUniquePrice": "<string>",
"goodsQuantity": 123
},
"paymentInfo": {
"productName": "SUBSCRIPTION",
"payMethodType": "<string>",
"payMethodName": "<string>",
"payMethodProperties": "<string>",
"payMethodUserAccountType": "<string>",
"payMethodUserAccountNo": "<string>",
"payMethodUserAccessToken": "<string>",
"cashierAppearance": "<string>",
"payMethodCountry": "<string>",
"cashierLanguage": "<string>"
},
"merchantSubscriptionId": "<string>",
"promotionInfo": {
"promotionCode": "<string>",
"couponId": "<string>"
},
"userCurrency": "<string>",
"startTime": "2023-11-07T05:31:56Z",
"successRedirectUrl": "<string>",
"failedRedirectUrl": "<string>",
"cancelRedirectUrl": "<string>",
"subscriptionManagementUrl": "<string>",
"extendInfo": "<string>",
"orderExpiredAt": "2023-11-07T05:31:56Z",
"addressInfo": {
"address": "<string>",
"city": "<string>",
"region": "<string>",
"postcode": "<string>",
"addressCountryCode": "<string>"
},
"brandInfo": {
"cashierLogoUrl": "<string>",
"cashierDisplayName": "<string>",
"cashierProductImageUrl": "<string>"
},
"riskData": {
"userType": "<string>",
"userCategory": "<string>",
"userLegalName": "<string>",
"userDisplayName": "<string>",
"userRegistrationIp": "<string>",
"userLastSeenIp": "<string>",
"userIsNew": "<string>",
"userIsFirstPurchase": "<string>"
}
}
'import requests
url = "https://api.example.com/api/v1/subscription/change"
payload = {
"subscriptionRequest": "<string>",
"originSubscriptionRequest": "ORG_SUB_REQ_001",
"remainingAmount": 50000,
"currency": "USD",
"requestedAt": "2023-11-07T05:31:56Z",
"notifyUrl": "https://merchant.com/notify",
"productInfoList": [
{
"description": "Premium Monthly Subscription",
"periodType": "MONTHLY",
"amount": 100000,
"periodInterval": 1,
"numberOfPeriod": 12,
"trialPeriodAmount": 0,
"numberOfTrialPeriod": 1,
"trialPeriodType": "MONTHLY",
"trialPeriodInterval": 1,
"scheduledAmounts": [
{
"period": "<string>",
"amount": "<string>"
}
]
}
],
"merchantInfo": {
"merchantId": "M0001",
"subMerchantId": "<string>"
},
"userInfo": {
"userId": "USER001",
"userEmail": "user@example.com",
"userTerminal": "<string>",
"userPhone": "+62-08990013157",
"userFirstName": "<string>",
"userLastName": "<string>",
"userCreatedAt": "2023-11-07T05:31:56Z"
},
"goodsInfo": {
"goodsId": "GOODS001",
"goodsName": "Premium Subscription Plan",
"goodsCategory": "<string>",
"goodsUrl": "<string>",
"appName": "<string>",
"skuName": "<string>",
"goodsUniquePrice": "<string>",
"goodsQuantity": 123
},
"paymentInfo": {
"productName": "SUBSCRIPTION",
"payMethodType": "<string>",
"payMethodName": "<string>",
"payMethodProperties": "<string>",
"payMethodUserAccountType": "<string>",
"payMethodUserAccountNo": "<string>",
"payMethodUserAccessToken": "<string>",
"cashierAppearance": "<string>",
"payMethodCountry": "<string>",
"cashierLanguage": "<string>"
},
"merchantSubscriptionId": "<string>",
"promotionInfo": {
"promotionCode": "<string>",
"couponId": "<string>"
},
"userCurrency": "<string>",
"startTime": "2023-11-07T05:31:56Z",
"successRedirectUrl": "<string>",
"failedRedirectUrl": "<string>",
"cancelRedirectUrl": "<string>",
"subscriptionManagementUrl": "<string>",
"extendInfo": "<string>",
"orderExpiredAt": "2023-11-07T05:31:56Z",
"addressInfo": {
"address": "<string>",
"city": "<string>",
"region": "<string>",
"postcode": "<string>",
"addressCountryCode": "<string>"
},
"brandInfo": {
"cashierLogoUrl": "<string>",
"cashierDisplayName": "<string>",
"cashierProductImageUrl": "<string>"
},
"riskData": {
"userType": "<string>",
"userCategory": "<string>",
"userLegalName": "<string>",
"userDisplayName": "<string>",
"userRegistrationIp": "<string>",
"userLastSeenIp": "<string>",
"userIsNew": "<string>",
"userIsFirstPurchase": "<string>"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
subscriptionRequest: '<string>',
originSubscriptionRequest: 'ORG_SUB_REQ_001',
remainingAmount: 50000,
currency: 'USD',
requestedAt: '2023-11-07T05:31:56Z',
notifyUrl: 'https://merchant.com/notify',
productInfoList: [
{
description: 'Premium Monthly Subscription',
periodType: 'MONTHLY',
amount: 100000,
periodInterval: 1,
numberOfPeriod: 12,
trialPeriodAmount: 0,
numberOfTrialPeriod: 1,
trialPeriodType: 'MONTHLY',
trialPeriodInterval: 1,
scheduledAmounts: [{period: '<string>', amount: '<string>'}]
}
],
merchantInfo: {merchantId: 'M0001', subMerchantId: '<string>'},
userInfo: {
userId: 'USER001',
userEmail: 'user@example.com',
userTerminal: '<string>',
userPhone: '+62-08990013157',
userFirstName: '<string>',
userLastName: '<string>',
userCreatedAt: '2023-11-07T05:31:56Z'
},
goodsInfo: {
goodsId: 'GOODS001',
goodsName: 'Premium Subscription Plan',
goodsCategory: '<string>',
goodsUrl: '<string>',
appName: '<string>',
skuName: '<string>',
goodsUniquePrice: '<string>',
goodsQuantity: 123
},
paymentInfo: {
productName: 'SUBSCRIPTION',
payMethodType: '<string>',
payMethodName: '<string>',
payMethodProperties: '<string>',
payMethodUserAccountType: '<string>',
payMethodUserAccountNo: '<string>',
payMethodUserAccessToken: '<string>',
cashierAppearance: '<string>',
payMethodCountry: '<string>',
cashierLanguage: '<string>'
},
merchantSubscriptionId: '<string>',
promotionInfo: {promotionCode: '<string>', couponId: '<string>'},
userCurrency: '<string>',
startTime: '2023-11-07T05:31:56Z',
successRedirectUrl: '<string>',
failedRedirectUrl: '<string>',
cancelRedirectUrl: '<string>',
subscriptionManagementUrl: '<string>',
extendInfo: '<string>',
orderExpiredAt: '2023-11-07T05:31:56Z',
addressInfo: {
address: '<string>',
city: '<string>',
region: '<string>',
postcode: '<string>',
addressCountryCode: '<string>'
},
brandInfo: {
cashierLogoUrl: '<string>',
cashierDisplayName: '<string>',
cashierProductImageUrl: '<string>'
},
riskData: {
userType: '<string>',
userCategory: '<string>',
userLegalName: '<string>',
userDisplayName: '<string>',
userRegistrationIp: '<string>',
userLastSeenIp: '<string>',
userIsNew: '<string>',
userIsFirstPurchase: '<string>'
}
})
};
fetch('https://api.example.com/api/v1/subscription/change', 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.example.com/api/v1/subscription/change",
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([
'subscriptionRequest' => '<string>',
'originSubscriptionRequest' => 'ORG_SUB_REQ_001',
'remainingAmount' => 50000,
'currency' => 'USD',
'requestedAt' => '2023-11-07T05:31:56Z',
'notifyUrl' => 'https://merchant.com/notify',
'productInfoList' => [
[
'description' => 'Premium Monthly Subscription',
'periodType' => 'MONTHLY',
'amount' => 100000,
'periodInterval' => 1,
'numberOfPeriod' => 12,
'trialPeriodAmount' => 0,
'numberOfTrialPeriod' => 1,
'trialPeriodType' => 'MONTHLY',
'trialPeriodInterval' => 1,
'scheduledAmounts' => [
[
'period' => '<string>',
'amount' => '<string>'
]
]
]
],
'merchantInfo' => [
'merchantId' => 'M0001',
'subMerchantId' => '<string>'
],
'userInfo' => [
'userId' => 'USER001',
'userEmail' => 'user@example.com',
'userTerminal' => '<string>',
'userPhone' => '+62-08990013157',
'userFirstName' => '<string>',
'userLastName' => '<string>',
'userCreatedAt' => '2023-11-07T05:31:56Z'
],
'goodsInfo' => [
'goodsId' => 'GOODS001',
'goodsName' => 'Premium Subscription Plan',
'goodsCategory' => '<string>',
'goodsUrl' => '<string>',
'appName' => '<string>',
'skuName' => '<string>',
'goodsUniquePrice' => '<string>',
'goodsQuantity' => 123
],
'paymentInfo' => [
'productName' => 'SUBSCRIPTION',
'payMethodType' => '<string>',
'payMethodName' => '<string>',
'payMethodProperties' => '<string>',
'payMethodUserAccountType' => '<string>',
'payMethodUserAccountNo' => '<string>',
'payMethodUserAccessToken' => '<string>',
'cashierAppearance' => '<string>',
'payMethodCountry' => '<string>',
'cashierLanguage' => '<string>'
],
'merchantSubscriptionId' => '<string>',
'promotionInfo' => [
'promotionCode' => '<string>',
'couponId' => '<string>'
],
'userCurrency' => '<string>',
'startTime' => '2023-11-07T05:31:56Z',
'successRedirectUrl' => '<string>',
'failedRedirectUrl' => '<string>',
'cancelRedirectUrl' => '<string>',
'subscriptionManagementUrl' => '<string>',
'extendInfo' => '<string>',
'orderExpiredAt' => '2023-11-07T05:31:56Z',
'addressInfo' => [
'address' => '<string>',
'city' => '<string>',
'region' => '<string>',
'postcode' => '<string>',
'addressCountryCode' => '<string>'
],
'brandInfo' => [
'cashierLogoUrl' => '<string>',
'cashierDisplayName' => '<string>',
'cashierProductImageUrl' => '<string>'
],
'riskData' => [
'userType' => '<string>',
'userCategory' => '<string>',
'userLegalName' => '<string>',
'userDisplayName' => '<string>',
'userRegistrationIp' => '<string>',
'userLastSeenIp' => '<string>',
'userIsNew' => '<string>',
'userIsFirstPurchase' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"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.example.com/api/v1/subscription/change"
payload := strings.NewReader("{\n \"subscriptionRequest\": \"<string>\",\n \"originSubscriptionRequest\": \"ORG_SUB_REQ_001\",\n \"remainingAmount\": 50000,\n \"currency\": \"USD\",\n \"requestedAt\": \"2023-11-07T05:31:56Z\",\n \"notifyUrl\": \"https://merchant.com/notify\",\n \"productInfoList\": [\n {\n \"description\": \"Premium Monthly Subscription\",\n \"periodType\": \"MONTHLY\",\n \"amount\": 100000,\n \"periodInterval\": 1,\n \"numberOfPeriod\": 12,\n \"trialPeriodAmount\": 0,\n \"numberOfTrialPeriod\": 1,\n \"trialPeriodType\": \"MONTHLY\",\n \"trialPeriodInterval\": 1,\n \"scheduledAmounts\": [\n {\n \"period\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ]\n }\n ],\n \"merchantInfo\": {\n \"merchantId\": \"M0001\",\n \"subMerchantId\": \"<string>\"\n },\n \"userInfo\": {\n \"userId\": \"USER001\",\n \"userEmail\": \"user@example.com\",\n \"userTerminal\": \"<string>\",\n \"userPhone\": \"+62-08990013157\",\n \"userFirstName\": \"<string>\",\n \"userLastName\": \"<string>\",\n \"userCreatedAt\": \"2023-11-07T05:31:56Z\"\n },\n \"goodsInfo\": {\n \"goodsId\": \"GOODS001\",\n \"goodsName\": \"Premium Subscription Plan\",\n \"goodsCategory\": \"<string>\",\n \"goodsUrl\": \"<string>\",\n \"appName\": \"<string>\",\n \"skuName\": \"<string>\",\n \"goodsUniquePrice\": \"<string>\",\n \"goodsQuantity\": 123\n },\n \"paymentInfo\": {\n \"productName\": \"SUBSCRIPTION\",\n \"payMethodType\": \"<string>\",\n \"payMethodName\": \"<string>\",\n \"payMethodProperties\": \"<string>\",\n \"payMethodUserAccountType\": \"<string>\",\n \"payMethodUserAccountNo\": \"<string>\",\n \"payMethodUserAccessToken\": \"<string>\",\n \"cashierAppearance\": \"<string>\",\n \"payMethodCountry\": \"<string>\",\n \"cashierLanguage\": \"<string>\"\n },\n \"merchantSubscriptionId\": \"<string>\",\n \"promotionInfo\": {\n \"promotionCode\": \"<string>\",\n \"couponId\": \"<string>\"\n },\n \"userCurrency\": \"<string>\",\n \"startTime\": \"2023-11-07T05:31:56Z\",\n \"successRedirectUrl\": \"<string>\",\n \"failedRedirectUrl\": \"<string>\",\n \"cancelRedirectUrl\": \"<string>\",\n \"subscriptionManagementUrl\": \"<string>\",\n \"extendInfo\": \"<string>\",\n \"orderExpiredAt\": \"2023-11-07T05:31:56Z\",\n \"addressInfo\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"postcode\": \"<string>\",\n \"addressCountryCode\": \"<string>\"\n },\n \"brandInfo\": {\n \"cashierLogoUrl\": \"<string>\",\n \"cashierDisplayName\": \"<string>\",\n \"cashierProductImageUrl\": \"<string>\"\n },\n \"riskData\": {\n \"userType\": \"<string>\",\n \"userCategory\": \"<string>\",\n \"userLegalName\": \"<string>\",\n \"userDisplayName\": \"<string>\",\n \"userRegistrationIp\": \"<string>\",\n \"userLastSeenIp\": \"<string>\",\n \"userIsNew\": \"<string>\",\n \"userIsFirstPurchase\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/api/v1/subscription/change")
.header("Content-Type", "application/json")
.body("{\n \"subscriptionRequest\": \"<string>\",\n \"originSubscriptionRequest\": \"ORG_SUB_REQ_001\",\n \"remainingAmount\": 50000,\n \"currency\": \"USD\",\n \"requestedAt\": \"2023-11-07T05:31:56Z\",\n \"notifyUrl\": \"https://merchant.com/notify\",\n \"productInfoList\": [\n {\n \"description\": \"Premium Monthly Subscription\",\n \"periodType\": \"MONTHLY\",\n \"amount\": 100000,\n \"periodInterval\": 1,\n \"numberOfPeriod\": 12,\n \"trialPeriodAmount\": 0,\n \"numberOfTrialPeriod\": 1,\n \"trialPeriodType\": \"MONTHLY\",\n \"trialPeriodInterval\": 1,\n \"scheduledAmounts\": [\n {\n \"period\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ]\n }\n ],\n \"merchantInfo\": {\n \"merchantId\": \"M0001\",\n \"subMerchantId\": \"<string>\"\n },\n \"userInfo\": {\n \"userId\": \"USER001\",\n \"userEmail\": \"user@example.com\",\n \"userTerminal\": \"<string>\",\n \"userPhone\": \"+62-08990013157\",\n \"userFirstName\": \"<string>\",\n \"userLastName\": \"<string>\",\n \"userCreatedAt\": \"2023-11-07T05:31:56Z\"\n },\n \"goodsInfo\": {\n \"goodsId\": \"GOODS001\",\n \"goodsName\": \"Premium Subscription Plan\",\n \"goodsCategory\": \"<string>\",\n \"goodsUrl\": \"<string>\",\n \"appName\": \"<string>\",\n \"skuName\": \"<string>\",\n \"goodsUniquePrice\": \"<string>\",\n \"goodsQuantity\": 123\n },\n \"paymentInfo\": {\n \"productName\": \"SUBSCRIPTION\",\n \"payMethodType\": \"<string>\",\n \"payMethodName\": \"<string>\",\n \"payMethodProperties\": \"<string>\",\n \"payMethodUserAccountType\": \"<string>\",\n \"payMethodUserAccountNo\": \"<string>\",\n \"payMethodUserAccessToken\": \"<string>\",\n \"cashierAppearance\": \"<string>\",\n \"payMethodCountry\": \"<string>\",\n \"cashierLanguage\": \"<string>\"\n },\n \"merchantSubscriptionId\": \"<string>\",\n \"promotionInfo\": {\n \"promotionCode\": \"<string>\",\n \"couponId\": \"<string>\"\n },\n \"userCurrency\": \"<string>\",\n \"startTime\": \"2023-11-07T05:31:56Z\",\n \"successRedirectUrl\": \"<string>\",\n \"failedRedirectUrl\": \"<string>\",\n \"cancelRedirectUrl\": \"<string>\",\n \"subscriptionManagementUrl\": \"<string>\",\n \"extendInfo\": \"<string>\",\n \"orderExpiredAt\": \"2023-11-07T05:31:56Z\",\n \"addressInfo\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"postcode\": \"<string>\",\n \"addressCountryCode\": \"<string>\"\n },\n \"brandInfo\": {\n \"cashierLogoUrl\": \"<string>\",\n \"cashierDisplayName\": \"<string>\",\n \"cashierProductImageUrl\": \"<string>\"\n },\n \"riskData\": {\n \"userType\": \"<string>\",\n \"userCategory\": \"<string>\",\n \"userLegalName\": \"<string>\",\n \"userDisplayName\": \"<string>\",\n \"userRegistrationIp\": \"<string>\",\n \"userLastSeenIp\": \"<string>\",\n \"userIsNew\": \"<string>\",\n \"userIsFirstPurchase\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/subscription/change")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"subscriptionRequest\": \"<string>\",\n \"originSubscriptionRequest\": \"ORG_SUB_REQ_001\",\n \"remainingAmount\": 50000,\n \"currency\": \"USD\",\n \"requestedAt\": \"2023-11-07T05:31:56Z\",\n \"notifyUrl\": \"https://merchant.com/notify\",\n \"productInfoList\": [\n {\n \"description\": \"Premium Monthly Subscription\",\n \"periodType\": \"MONTHLY\",\n \"amount\": 100000,\n \"periodInterval\": 1,\n \"numberOfPeriod\": 12,\n \"trialPeriodAmount\": 0,\n \"numberOfTrialPeriod\": 1,\n \"trialPeriodType\": \"MONTHLY\",\n \"trialPeriodInterval\": 1,\n \"scheduledAmounts\": [\n {\n \"period\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ]\n }\n ],\n \"merchantInfo\": {\n \"merchantId\": \"M0001\",\n \"subMerchantId\": \"<string>\"\n },\n \"userInfo\": {\n \"userId\": \"USER001\",\n \"userEmail\": \"user@example.com\",\n \"userTerminal\": \"<string>\",\n \"userPhone\": \"+62-08990013157\",\n \"userFirstName\": \"<string>\",\n \"userLastName\": \"<string>\",\n \"userCreatedAt\": \"2023-11-07T05:31:56Z\"\n },\n \"goodsInfo\": {\n \"goodsId\": \"GOODS001\",\n \"goodsName\": \"Premium Subscription Plan\",\n \"goodsCategory\": \"<string>\",\n \"goodsUrl\": \"<string>\",\n \"appName\": \"<string>\",\n \"skuName\": \"<string>\",\n \"goodsUniquePrice\": \"<string>\",\n \"goodsQuantity\": 123\n },\n \"paymentInfo\": {\n \"productName\": \"SUBSCRIPTION\",\n \"payMethodType\": \"<string>\",\n \"payMethodName\": \"<string>\",\n \"payMethodProperties\": \"<string>\",\n \"payMethodUserAccountType\": \"<string>\",\n \"payMethodUserAccountNo\": \"<string>\",\n \"payMethodUserAccessToken\": \"<string>\",\n \"cashierAppearance\": \"<string>\",\n \"payMethodCountry\": \"<string>\",\n \"cashierLanguage\": \"<string>\"\n },\n \"merchantSubscriptionId\": \"<string>\",\n \"promotionInfo\": {\n \"promotionCode\": \"<string>\",\n \"couponId\": \"<string>\"\n },\n \"userCurrency\": \"<string>\",\n \"startTime\": \"2023-11-07T05:31:56Z\",\n \"successRedirectUrl\": \"<string>\",\n \"failedRedirectUrl\": \"<string>\",\n \"cancelRedirectUrl\": \"<string>\",\n \"subscriptionManagementUrl\": \"<string>\",\n \"extendInfo\": \"<string>\",\n \"orderExpiredAt\": \"2023-11-07T05:31:56Z\",\n \"addressInfo\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"postcode\": \"<string>\",\n \"addressCountryCode\": \"<string>\"\n },\n \"brandInfo\": {\n \"cashierLogoUrl\": \"<string>\",\n \"cashierDisplayName\": \"<string>\",\n \"cashierProductImageUrl\": \"<string>\"\n },\n \"riskData\": {\n \"userType\": \"<string>\",\n \"userCategory\": \"<string>\",\n \"userLegalName\": \"<string>\",\n \"userDisplayName\": \"<string>\",\n \"userRegistrationIp\": \"<string>\",\n \"userLastSeenIp\": \"<string>\",\n \"userIsNew\": \"<string>\",\n \"userIsFirstPurchase\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"msg": "success",
"data": {
"subscriptionId": "<string>",
"originSubscriptionRequest": "<string>",
"subscriptionRequest": "<string>",
"merchantSubscriptionId": "<string>",
"subscriptionChangeStatus": "<string>",
"subscriptionAction": "<string>"
}
}Subscription change
curl --request POST \
--url https://api.example.com/api/v1/subscription/change \
--header 'Content-Type: application/json' \
--data '
{
"subscriptionRequest": "<string>",
"originSubscriptionRequest": "ORG_SUB_REQ_001",
"remainingAmount": 50000,
"currency": "USD",
"requestedAt": "2023-11-07T05:31:56Z",
"notifyUrl": "https://merchant.com/notify",
"productInfoList": [
{
"description": "Premium Monthly Subscription",
"periodType": "MONTHLY",
"amount": 100000,
"periodInterval": 1,
"numberOfPeriod": 12,
"trialPeriodAmount": 0,
"numberOfTrialPeriod": 1,
"trialPeriodType": "MONTHLY",
"trialPeriodInterval": 1,
"scheduledAmounts": [
{
"period": "<string>",
"amount": "<string>"
}
]
}
],
"merchantInfo": {
"merchantId": "M0001",
"subMerchantId": "<string>"
},
"userInfo": {
"userId": "USER001",
"userEmail": "user@example.com",
"userTerminal": "<string>",
"userPhone": "+62-08990013157",
"userFirstName": "<string>",
"userLastName": "<string>",
"userCreatedAt": "2023-11-07T05:31:56Z"
},
"goodsInfo": {
"goodsId": "GOODS001",
"goodsName": "Premium Subscription Plan",
"goodsCategory": "<string>",
"goodsUrl": "<string>",
"appName": "<string>",
"skuName": "<string>",
"goodsUniquePrice": "<string>",
"goodsQuantity": 123
},
"paymentInfo": {
"productName": "SUBSCRIPTION",
"payMethodType": "<string>",
"payMethodName": "<string>",
"payMethodProperties": "<string>",
"payMethodUserAccountType": "<string>",
"payMethodUserAccountNo": "<string>",
"payMethodUserAccessToken": "<string>",
"cashierAppearance": "<string>",
"payMethodCountry": "<string>",
"cashierLanguage": "<string>"
},
"merchantSubscriptionId": "<string>",
"promotionInfo": {
"promotionCode": "<string>",
"couponId": "<string>"
},
"userCurrency": "<string>",
"startTime": "2023-11-07T05:31:56Z",
"successRedirectUrl": "<string>",
"failedRedirectUrl": "<string>",
"cancelRedirectUrl": "<string>",
"subscriptionManagementUrl": "<string>",
"extendInfo": "<string>",
"orderExpiredAt": "2023-11-07T05:31:56Z",
"addressInfo": {
"address": "<string>",
"city": "<string>",
"region": "<string>",
"postcode": "<string>",
"addressCountryCode": "<string>"
},
"brandInfo": {
"cashierLogoUrl": "<string>",
"cashierDisplayName": "<string>",
"cashierProductImageUrl": "<string>"
},
"riskData": {
"userType": "<string>",
"userCategory": "<string>",
"userLegalName": "<string>",
"userDisplayName": "<string>",
"userRegistrationIp": "<string>",
"userLastSeenIp": "<string>",
"userIsNew": "<string>",
"userIsFirstPurchase": "<string>"
}
}
'import requests
url = "https://api.example.com/api/v1/subscription/change"
payload = {
"subscriptionRequest": "<string>",
"originSubscriptionRequest": "ORG_SUB_REQ_001",
"remainingAmount": 50000,
"currency": "USD",
"requestedAt": "2023-11-07T05:31:56Z",
"notifyUrl": "https://merchant.com/notify",
"productInfoList": [
{
"description": "Premium Monthly Subscription",
"periodType": "MONTHLY",
"amount": 100000,
"periodInterval": 1,
"numberOfPeriod": 12,
"trialPeriodAmount": 0,
"numberOfTrialPeriod": 1,
"trialPeriodType": "MONTHLY",
"trialPeriodInterval": 1,
"scheduledAmounts": [
{
"period": "<string>",
"amount": "<string>"
}
]
}
],
"merchantInfo": {
"merchantId": "M0001",
"subMerchantId": "<string>"
},
"userInfo": {
"userId": "USER001",
"userEmail": "user@example.com",
"userTerminal": "<string>",
"userPhone": "+62-08990013157",
"userFirstName": "<string>",
"userLastName": "<string>",
"userCreatedAt": "2023-11-07T05:31:56Z"
},
"goodsInfo": {
"goodsId": "GOODS001",
"goodsName": "Premium Subscription Plan",
"goodsCategory": "<string>",
"goodsUrl": "<string>",
"appName": "<string>",
"skuName": "<string>",
"goodsUniquePrice": "<string>",
"goodsQuantity": 123
},
"paymentInfo": {
"productName": "SUBSCRIPTION",
"payMethodType": "<string>",
"payMethodName": "<string>",
"payMethodProperties": "<string>",
"payMethodUserAccountType": "<string>",
"payMethodUserAccountNo": "<string>",
"payMethodUserAccessToken": "<string>",
"cashierAppearance": "<string>",
"payMethodCountry": "<string>",
"cashierLanguage": "<string>"
},
"merchantSubscriptionId": "<string>",
"promotionInfo": {
"promotionCode": "<string>",
"couponId": "<string>"
},
"userCurrency": "<string>",
"startTime": "2023-11-07T05:31:56Z",
"successRedirectUrl": "<string>",
"failedRedirectUrl": "<string>",
"cancelRedirectUrl": "<string>",
"subscriptionManagementUrl": "<string>",
"extendInfo": "<string>",
"orderExpiredAt": "2023-11-07T05:31:56Z",
"addressInfo": {
"address": "<string>",
"city": "<string>",
"region": "<string>",
"postcode": "<string>",
"addressCountryCode": "<string>"
},
"brandInfo": {
"cashierLogoUrl": "<string>",
"cashierDisplayName": "<string>",
"cashierProductImageUrl": "<string>"
},
"riskData": {
"userType": "<string>",
"userCategory": "<string>",
"userLegalName": "<string>",
"userDisplayName": "<string>",
"userRegistrationIp": "<string>",
"userLastSeenIp": "<string>",
"userIsNew": "<string>",
"userIsFirstPurchase": "<string>"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
subscriptionRequest: '<string>',
originSubscriptionRequest: 'ORG_SUB_REQ_001',
remainingAmount: 50000,
currency: 'USD',
requestedAt: '2023-11-07T05:31:56Z',
notifyUrl: 'https://merchant.com/notify',
productInfoList: [
{
description: 'Premium Monthly Subscription',
periodType: 'MONTHLY',
amount: 100000,
periodInterval: 1,
numberOfPeriod: 12,
trialPeriodAmount: 0,
numberOfTrialPeriod: 1,
trialPeriodType: 'MONTHLY',
trialPeriodInterval: 1,
scheduledAmounts: [{period: '<string>', amount: '<string>'}]
}
],
merchantInfo: {merchantId: 'M0001', subMerchantId: '<string>'},
userInfo: {
userId: 'USER001',
userEmail: 'user@example.com',
userTerminal: '<string>',
userPhone: '+62-08990013157',
userFirstName: '<string>',
userLastName: '<string>',
userCreatedAt: '2023-11-07T05:31:56Z'
},
goodsInfo: {
goodsId: 'GOODS001',
goodsName: 'Premium Subscription Plan',
goodsCategory: '<string>',
goodsUrl: '<string>',
appName: '<string>',
skuName: '<string>',
goodsUniquePrice: '<string>',
goodsQuantity: 123
},
paymentInfo: {
productName: 'SUBSCRIPTION',
payMethodType: '<string>',
payMethodName: '<string>',
payMethodProperties: '<string>',
payMethodUserAccountType: '<string>',
payMethodUserAccountNo: '<string>',
payMethodUserAccessToken: '<string>',
cashierAppearance: '<string>',
payMethodCountry: '<string>',
cashierLanguage: '<string>'
},
merchantSubscriptionId: '<string>',
promotionInfo: {promotionCode: '<string>', couponId: '<string>'},
userCurrency: '<string>',
startTime: '2023-11-07T05:31:56Z',
successRedirectUrl: '<string>',
failedRedirectUrl: '<string>',
cancelRedirectUrl: '<string>',
subscriptionManagementUrl: '<string>',
extendInfo: '<string>',
orderExpiredAt: '2023-11-07T05:31:56Z',
addressInfo: {
address: '<string>',
city: '<string>',
region: '<string>',
postcode: '<string>',
addressCountryCode: '<string>'
},
brandInfo: {
cashierLogoUrl: '<string>',
cashierDisplayName: '<string>',
cashierProductImageUrl: '<string>'
},
riskData: {
userType: '<string>',
userCategory: '<string>',
userLegalName: '<string>',
userDisplayName: '<string>',
userRegistrationIp: '<string>',
userLastSeenIp: '<string>',
userIsNew: '<string>',
userIsFirstPurchase: '<string>'
}
})
};
fetch('https://api.example.com/api/v1/subscription/change', 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.example.com/api/v1/subscription/change",
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([
'subscriptionRequest' => '<string>',
'originSubscriptionRequest' => 'ORG_SUB_REQ_001',
'remainingAmount' => 50000,
'currency' => 'USD',
'requestedAt' => '2023-11-07T05:31:56Z',
'notifyUrl' => 'https://merchant.com/notify',
'productInfoList' => [
[
'description' => 'Premium Monthly Subscription',
'periodType' => 'MONTHLY',
'amount' => 100000,
'periodInterval' => 1,
'numberOfPeriod' => 12,
'trialPeriodAmount' => 0,
'numberOfTrialPeriod' => 1,
'trialPeriodType' => 'MONTHLY',
'trialPeriodInterval' => 1,
'scheduledAmounts' => [
[
'period' => '<string>',
'amount' => '<string>'
]
]
]
],
'merchantInfo' => [
'merchantId' => 'M0001',
'subMerchantId' => '<string>'
],
'userInfo' => [
'userId' => 'USER001',
'userEmail' => 'user@example.com',
'userTerminal' => '<string>',
'userPhone' => '+62-08990013157',
'userFirstName' => '<string>',
'userLastName' => '<string>',
'userCreatedAt' => '2023-11-07T05:31:56Z'
],
'goodsInfo' => [
'goodsId' => 'GOODS001',
'goodsName' => 'Premium Subscription Plan',
'goodsCategory' => '<string>',
'goodsUrl' => '<string>',
'appName' => '<string>',
'skuName' => '<string>',
'goodsUniquePrice' => '<string>',
'goodsQuantity' => 123
],
'paymentInfo' => [
'productName' => 'SUBSCRIPTION',
'payMethodType' => '<string>',
'payMethodName' => '<string>',
'payMethodProperties' => '<string>',
'payMethodUserAccountType' => '<string>',
'payMethodUserAccountNo' => '<string>',
'payMethodUserAccessToken' => '<string>',
'cashierAppearance' => '<string>',
'payMethodCountry' => '<string>',
'cashierLanguage' => '<string>'
],
'merchantSubscriptionId' => '<string>',
'promotionInfo' => [
'promotionCode' => '<string>',
'couponId' => '<string>'
],
'userCurrency' => '<string>',
'startTime' => '2023-11-07T05:31:56Z',
'successRedirectUrl' => '<string>',
'failedRedirectUrl' => '<string>',
'cancelRedirectUrl' => '<string>',
'subscriptionManagementUrl' => '<string>',
'extendInfo' => '<string>',
'orderExpiredAt' => '2023-11-07T05:31:56Z',
'addressInfo' => [
'address' => '<string>',
'city' => '<string>',
'region' => '<string>',
'postcode' => '<string>',
'addressCountryCode' => '<string>'
],
'brandInfo' => [
'cashierLogoUrl' => '<string>',
'cashierDisplayName' => '<string>',
'cashierProductImageUrl' => '<string>'
],
'riskData' => [
'userType' => '<string>',
'userCategory' => '<string>',
'userLegalName' => '<string>',
'userDisplayName' => '<string>',
'userRegistrationIp' => '<string>',
'userLastSeenIp' => '<string>',
'userIsNew' => '<string>',
'userIsFirstPurchase' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"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.example.com/api/v1/subscription/change"
payload := strings.NewReader("{\n \"subscriptionRequest\": \"<string>\",\n \"originSubscriptionRequest\": \"ORG_SUB_REQ_001\",\n \"remainingAmount\": 50000,\n \"currency\": \"USD\",\n \"requestedAt\": \"2023-11-07T05:31:56Z\",\n \"notifyUrl\": \"https://merchant.com/notify\",\n \"productInfoList\": [\n {\n \"description\": \"Premium Monthly Subscription\",\n \"periodType\": \"MONTHLY\",\n \"amount\": 100000,\n \"periodInterval\": 1,\n \"numberOfPeriod\": 12,\n \"trialPeriodAmount\": 0,\n \"numberOfTrialPeriod\": 1,\n \"trialPeriodType\": \"MONTHLY\",\n \"trialPeriodInterval\": 1,\n \"scheduledAmounts\": [\n {\n \"period\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ]\n }\n ],\n \"merchantInfo\": {\n \"merchantId\": \"M0001\",\n \"subMerchantId\": \"<string>\"\n },\n \"userInfo\": {\n \"userId\": \"USER001\",\n \"userEmail\": \"user@example.com\",\n \"userTerminal\": \"<string>\",\n \"userPhone\": \"+62-08990013157\",\n \"userFirstName\": \"<string>\",\n \"userLastName\": \"<string>\",\n \"userCreatedAt\": \"2023-11-07T05:31:56Z\"\n },\n \"goodsInfo\": {\n \"goodsId\": \"GOODS001\",\n \"goodsName\": \"Premium Subscription Plan\",\n \"goodsCategory\": \"<string>\",\n \"goodsUrl\": \"<string>\",\n \"appName\": \"<string>\",\n \"skuName\": \"<string>\",\n \"goodsUniquePrice\": \"<string>\",\n \"goodsQuantity\": 123\n },\n \"paymentInfo\": {\n \"productName\": \"SUBSCRIPTION\",\n \"payMethodType\": \"<string>\",\n \"payMethodName\": \"<string>\",\n \"payMethodProperties\": \"<string>\",\n \"payMethodUserAccountType\": \"<string>\",\n \"payMethodUserAccountNo\": \"<string>\",\n \"payMethodUserAccessToken\": \"<string>\",\n \"cashierAppearance\": \"<string>\",\n \"payMethodCountry\": \"<string>\",\n \"cashierLanguage\": \"<string>\"\n },\n \"merchantSubscriptionId\": \"<string>\",\n \"promotionInfo\": {\n \"promotionCode\": \"<string>\",\n \"couponId\": \"<string>\"\n },\n \"userCurrency\": \"<string>\",\n \"startTime\": \"2023-11-07T05:31:56Z\",\n \"successRedirectUrl\": \"<string>\",\n \"failedRedirectUrl\": \"<string>\",\n \"cancelRedirectUrl\": \"<string>\",\n \"subscriptionManagementUrl\": \"<string>\",\n \"extendInfo\": \"<string>\",\n \"orderExpiredAt\": \"2023-11-07T05:31:56Z\",\n \"addressInfo\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"postcode\": \"<string>\",\n \"addressCountryCode\": \"<string>\"\n },\n \"brandInfo\": {\n \"cashierLogoUrl\": \"<string>\",\n \"cashierDisplayName\": \"<string>\",\n \"cashierProductImageUrl\": \"<string>\"\n },\n \"riskData\": {\n \"userType\": \"<string>\",\n \"userCategory\": \"<string>\",\n \"userLegalName\": \"<string>\",\n \"userDisplayName\": \"<string>\",\n \"userRegistrationIp\": \"<string>\",\n \"userLastSeenIp\": \"<string>\",\n \"userIsNew\": \"<string>\",\n \"userIsFirstPurchase\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/api/v1/subscription/change")
.header("Content-Type", "application/json")
.body("{\n \"subscriptionRequest\": \"<string>\",\n \"originSubscriptionRequest\": \"ORG_SUB_REQ_001\",\n \"remainingAmount\": 50000,\n \"currency\": \"USD\",\n \"requestedAt\": \"2023-11-07T05:31:56Z\",\n \"notifyUrl\": \"https://merchant.com/notify\",\n \"productInfoList\": [\n {\n \"description\": \"Premium Monthly Subscription\",\n \"periodType\": \"MONTHLY\",\n \"amount\": 100000,\n \"periodInterval\": 1,\n \"numberOfPeriod\": 12,\n \"trialPeriodAmount\": 0,\n \"numberOfTrialPeriod\": 1,\n \"trialPeriodType\": \"MONTHLY\",\n \"trialPeriodInterval\": 1,\n \"scheduledAmounts\": [\n {\n \"period\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ]\n }\n ],\n \"merchantInfo\": {\n \"merchantId\": \"M0001\",\n \"subMerchantId\": \"<string>\"\n },\n \"userInfo\": {\n \"userId\": \"USER001\",\n \"userEmail\": \"user@example.com\",\n \"userTerminal\": \"<string>\",\n \"userPhone\": \"+62-08990013157\",\n \"userFirstName\": \"<string>\",\n \"userLastName\": \"<string>\",\n \"userCreatedAt\": \"2023-11-07T05:31:56Z\"\n },\n \"goodsInfo\": {\n \"goodsId\": \"GOODS001\",\n \"goodsName\": \"Premium Subscription Plan\",\n \"goodsCategory\": \"<string>\",\n \"goodsUrl\": \"<string>\",\n \"appName\": \"<string>\",\n \"skuName\": \"<string>\",\n \"goodsUniquePrice\": \"<string>\",\n \"goodsQuantity\": 123\n },\n \"paymentInfo\": {\n \"productName\": \"SUBSCRIPTION\",\n \"payMethodType\": \"<string>\",\n \"payMethodName\": \"<string>\",\n \"payMethodProperties\": \"<string>\",\n \"payMethodUserAccountType\": \"<string>\",\n \"payMethodUserAccountNo\": \"<string>\",\n \"payMethodUserAccessToken\": \"<string>\",\n \"cashierAppearance\": \"<string>\",\n \"payMethodCountry\": \"<string>\",\n \"cashierLanguage\": \"<string>\"\n },\n \"merchantSubscriptionId\": \"<string>\",\n \"promotionInfo\": {\n \"promotionCode\": \"<string>\",\n \"couponId\": \"<string>\"\n },\n \"userCurrency\": \"<string>\",\n \"startTime\": \"2023-11-07T05:31:56Z\",\n \"successRedirectUrl\": \"<string>\",\n \"failedRedirectUrl\": \"<string>\",\n \"cancelRedirectUrl\": \"<string>\",\n \"subscriptionManagementUrl\": \"<string>\",\n \"extendInfo\": \"<string>\",\n \"orderExpiredAt\": \"2023-11-07T05:31:56Z\",\n \"addressInfo\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"postcode\": \"<string>\",\n \"addressCountryCode\": \"<string>\"\n },\n \"brandInfo\": {\n \"cashierLogoUrl\": \"<string>\",\n \"cashierDisplayName\": \"<string>\",\n \"cashierProductImageUrl\": \"<string>\"\n },\n \"riskData\": {\n \"userType\": \"<string>\",\n \"userCategory\": \"<string>\",\n \"userLegalName\": \"<string>\",\n \"userDisplayName\": \"<string>\",\n \"userRegistrationIp\": \"<string>\",\n \"userLastSeenIp\": \"<string>\",\n \"userIsNew\": \"<string>\",\n \"userIsFirstPurchase\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/subscription/change")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"subscriptionRequest\": \"<string>\",\n \"originSubscriptionRequest\": \"ORG_SUB_REQ_001\",\n \"remainingAmount\": 50000,\n \"currency\": \"USD\",\n \"requestedAt\": \"2023-11-07T05:31:56Z\",\n \"notifyUrl\": \"https://merchant.com/notify\",\n \"productInfoList\": [\n {\n \"description\": \"Premium Monthly Subscription\",\n \"periodType\": \"MONTHLY\",\n \"amount\": 100000,\n \"periodInterval\": 1,\n \"numberOfPeriod\": 12,\n \"trialPeriodAmount\": 0,\n \"numberOfTrialPeriod\": 1,\n \"trialPeriodType\": \"MONTHLY\",\n \"trialPeriodInterval\": 1,\n \"scheduledAmounts\": [\n {\n \"period\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ]\n }\n ],\n \"merchantInfo\": {\n \"merchantId\": \"M0001\",\n \"subMerchantId\": \"<string>\"\n },\n \"userInfo\": {\n \"userId\": \"USER001\",\n \"userEmail\": \"user@example.com\",\n \"userTerminal\": \"<string>\",\n \"userPhone\": \"+62-08990013157\",\n \"userFirstName\": \"<string>\",\n \"userLastName\": \"<string>\",\n \"userCreatedAt\": \"2023-11-07T05:31:56Z\"\n },\n \"goodsInfo\": {\n \"goodsId\": \"GOODS001\",\n \"goodsName\": \"Premium Subscription Plan\",\n \"goodsCategory\": \"<string>\",\n \"goodsUrl\": \"<string>\",\n \"appName\": \"<string>\",\n \"skuName\": \"<string>\",\n \"goodsUniquePrice\": \"<string>\",\n \"goodsQuantity\": 123\n },\n \"paymentInfo\": {\n \"productName\": \"SUBSCRIPTION\",\n \"payMethodType\": \"<string>\",\n \"payMethodName\": \"<string>\",\n \"payMethodProperties\": \"<string>\",\n \"payMethodUserAccountType\": \"<string>\",\n \"payMethodUserAccountNo\": \"<string>\",\n \"payMethodUserAccessToken\": \"<string>\",\n \"cashierAppearance\": \"<string>\",\n \"payMethodCountry\": \"<string>\",\n \"cashierLanguage\": \"<string>\"\n },\n \"merchantSubscriptionId\": \"<string>\",\n \"promotionInfo\": {\n \"promotionCode\": \"<string>\",\n \"couponId\": \"<string>\"\n },\n \"userCurrency\": \"<string>\",\n \"startTime\": \"2023-11-07T05:31:56Z\",\n \"successRedirectUrl\": \"<string>\",\n \"failedRedirectUrl\": \"<string>\",\n \"cancelRedirectUrl\": \"<string>\",\n \"subscriptionManagementUrl\": \"<string>\",\n \"extendInfo\": \"<string>\",\n \"orderExpiredAt\": \"2023-11-07T05:31:56Z\",\n \"addressInfo\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"postcode\": \"<string>\",\n \"addressCountryCode\": \"<string>\"\n },\n \"brandInfo\": {\n \"cashierLogoUrl\": \"<string>\",\n \"cashierDisplayName\": \"<string>\",\n \"cashierProductImageUrl\": \"<string>\"\n },\n \"riskData\": {\n \"userType\": \"<string>\",\n \"userCategory\": \"<string>\",\n \"userLegalName\": \"<string>\",\n \"userDisplayName\": \"<string>\",\n \"userRegistrationIp\": \"<string>\",\n \"userLastSeenIp\": \"<string>\",\n \"userIsNew\": \"<string>\",\n \"userIsFirstPurchase\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"msg": "success",
"data": {
"subscriptionId": "<string>",
"originSubscriptionRequest": "<string>",
"subscriptionRequest": "<string>",
"merchantSubscriptionId": "<string>",
"subscriptionChangeStatus": "<string>",
"subscriptionAction": "<string>"
}
}Body
Subscription change request
New subscription request id sent from Merchant. It will also be used for idempotent check.
32Original subscription request id that needs to be changed
32"ORG_SUB_REQ_001"
Remaining amount from the original subscription to be applied to the new subscription
2450000
Subscription currency, for example USD
12"USD"
Merchant-side request time
The callback address to notify the merchant after the subscription change is completed / failed
1024"https://merchant.com/notify"
New subscription product information list
1Show child attributes
Show child attributes
Merchant info
Show child attributes
Show child attributes
User info
Show child attributes
Show child attributes
Merchant goods information
Show child attributes
Show child attributes
Payment information
Show child attributes
Show child attributes
New merchant subscription plan ID assigned to this user
64Promotion info applied to the new subscription plan during upgrade or downgrade. When provided, Waffo applies the matched coupon to the new subscription amount.
Show child attributes
Show child attributes
User payment currency. This is needed when merchant order currency is NOT the same as user payment currency
12Specified new subscription start time. If not provided, the new subscription starts immediately.
The address of the merchant page to redirect to after successful subscription change. If no value is provided, it will stay on the cashier page after successful payment.
1024The address of the merchant page to which the payment pre-verification fails, or the redirection after the payment fails. If no value is provided, it will stay on the cashier page after the payment fails
1024User will be redirected to this page if user choose to cancel and not continue the payment
512It refers to the subscription management page for users on the merchant side.
256Reserved. Json format e.g. {"key1":"value1", "key2":"value2"}
256The order expiry time set by merchant. User is required to input payment data on Waffo cashier page prior to merchant's order expiry time. If not provided, the default is 4 hours
Address Information
Show child attributes
Show child attributes
Brand display information for cashier
Show child attributes
Show child attributes
Risk data for compliance and risk management
Show child attributes
Show child attributes
Was this page helpful?