Resume Subscription
curl --request POST \
--url https://uat-api.clinkbill.com/api/subscription/{id}/resume \
--header 'X-API-KEY: <api-key>' \
--header 'X-Timestamp: <x-timestamp>'HttpResponse<String> response = Unirest.post("https://uat-api.clinkbill.com/api/subscription/{id}/resume")
.header("X-Timestamp", "<x-timestamp>")
.header("X-API-KEY", "<api-key>")
.asString();import requests
url = "https://uat-api.clinkbill.com/api/subscription/{id}/resume"
headers = {
"X-Timestamp": "<x-timestamp>",
"X-API-KEY": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Timestamp': '<x-timestamp>', 'X-API-KEY': '<api-key>'}
};
fetch('https://uat-api.clinkbill.com/api/subscription/{id}/resume', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"code": 200,
"msg": "success",
"data": {
"subscriptionId": "sub_xxxxx",
"customerId": "cus_xxxxx",
"productId": "prd_xxxxx",
"priceId": "price_xxxxx",
"priceSnapshotId": "pricesns_xxxxx",
"createTime": 1793491200000,
"quantity": 1,
"paymentMethodType": "card",
"paymentInstrumentId": "pi_xxxxx",
"status": "active",
"billing": "charge_automatically",
"currency": "USD",
"currentPeriodStart": 1793491200000,
"currentPeriodEnd": 1796688000000,
"recurringInvoiceItem": {
"invoiceItemId": "ii_xxxxx",
"amount": "20.00",
"currency": "USD",
"periodStart": 1794096000000,
"periodEnd": 1796688000000,
"discountAmount": "2.00",
"paymentAmount": "18.00",
"description": "Monthly membership",
"price": {
"productId": "prd_xxxxx",
"productName": "Monthly Membership",
"productUrl": "https://merchant.example.com/membership",
"priceId": "price_xxxxx",
"priceSnapshotId": "pricesns_xxxxx",
"unitAmount": "20.00",
"quantity": 1,
"recurring": {
"interval": "month",
"intervalCount": 1,
"pricingModel": "flat_rate"
}
}
}
}
}Subscription
恢复订阅
Resume a paused subscription immediately. The subscription returns to active with its remaining service time and any automatic resume schedule is cleared. Resuming does not create an invoice or charge the customer.
POST
/
subscription
/
{id}
/
resume
Resume Subscription
curl --request POST \
--url https://uat-api.clinkbill.com/api/subscription/{id}/resume \
--header 'X-API-KEY: <api-key>' \
--header 'X-Timestamp: <x-timestamp>'HttpResponse<String> response = Unirest.post("https://uat-api.clinkbill.com/api/subscription/{id}/resume")
.header("X-Timestamp", "<x-timestamp>")
.header("X-API-KEY", "<api-key>")
.asString();import requests
url = "https://uat-api.clinkbill.com/api/subscription/{id}/resume"
headers = {
"X-Timestamp": "<x-timestamp>",
"X-API-KEY": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Timestamp': '<x-timestamp>', 'X-API-KEY': '<api-key>'}
};
fetch('https://uat-api.clinkbill.com/api/subscription/{id}/resume', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"code": 200,
"msg": "success",
"data": {
"subscriptionId": "sub_xxxxx",
"customerId": "cus_xxxxx",
"productId": "prd_xxxxx",
"priceId": "price_xxxxx",
"priceSnapshotId": "pricesns_xxxxx",
"createTime": 1793491200000,
"quantity": 1,
"paymentMethodType": "card",
"paymentInstrumentId": "pi_xxxxx",
"status": "active",
"billing": "charge_automatically",
"currency": "USD",
"currentPeriodStart": 1793491200000,
"currentPeriodEnd": 1796688000000,
"recurringInvoiceItem": {
"invoiceItemId": "ii_xxxxx",
"amount": "20.00",
"currency": "USD",
"periodStart": 1794096000000,
"periodEnd": 1796688000000,
"discountAmount": "2.00",
"paymentAmount": "18.00",
"description": "Monthly membership",
"price": {
"productId": "prd_xxxxx",
"productName": "Monthly Membership",
"productUrl": "https://merchant.example.com/membership",
"priceId": "price_xxxxx",
"priceSnapshotId": "pricesns_xxxxx",
"unitAmount": "20.00",
"quantity": 1,
"recurring": {
"interval": "month",
"intervalCount": 1,
"pricingModel": "flat_rate"
}
}
}
}
}无需请求体。恢复后,订阅从
paused 变为 active,自动恢复计划和 pause 对象随之清除。使用响应中的 currentPeriodEnd 更新账期末。例如,暂停时还剩 4 天,恢复后从实际恢复时刻起继续使用这 4 天。
恢复时不出账、不扣款,收到 subscription.resumed 即可恢复权益。订阅当前未暂停时返回 90100259。请求头
响应
Updated subscription on success. Check the business code in the response.