curl --request POST \
--url https://uat-api.clinkbill.com/api/subscription/{id}/resume/schedule \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--header 'X-Timestamp: <x-timestamp>' \
--data '
{
"resumeAt": null
}
'{
"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": "paused",
"billing": "charge_automatically",
"currency": "USD",
"currentPeriodStart": 1793491200000,
"currentPeriodEnd": 1796083200000,
"recurringInvoiceItem": {
"invoiceItemId": "ii_xxxxx",
"amount": "20.00",
"currency": "USD",
"periodStart": 1793491200000,
"periodEnd": 1796083200000,
"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"
}
}
},
"pause": {
"pausedAt": 1795737600000,
"remainingSeconds": 345600,
"reason": "Customer requested a break"
}
}
}Subscription
修改自动恢复时间
Set or replace the automatic resume time of a paused subscription. Send {"resumeAt": null}, an empty object, or no body to clear the schedule and keep the subscription paused until manually resumed.
POST
/
subscription
/
{id}
/
resume
/
schedule
curl --request POST \
--url https://uat-api.clinkbill.com/api/subscription/{id}/resume/schedule \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--header 'X-Timestamp: <x-timestamp>' \
--data '
{
"resumeAt": null
}
'{
"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": "paused",
"billing": "charge_automatically",
"currency": "USD",
"currentPeriodStart": 1793491200000,
"currentPeriodEnd": 1796083200000,
"recurringInvoiceItem": {
"invoiceItemId": "ii_xxxxx",
"amount": "20.00",
"currency": "USD",
"periodStart": 1793491200000,
"periodEnd": 1796083200000,
"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"
}
}
},
"pause": {
"pausedAt": 1795737600000,
"remainingSeconds": 345600,
"reason": "Customer requested a break"
}
}
}对
不传请求体或传
paused 订阅传入未来的 Unix 毫秒时间戳 resumeAt,即可设置或替换自动恢复时间。例如,JavaScript 表达式 { resumeAt: Date.now() + 24 * 60 * 60 * 1000 } 表示 24 小时后恢复。
传入以下 JSON 可改为手动恢复。订阅会继续保持暂停。
{ "resumeAt": null }
{} 效果相同。设置、修改或清空自动恢复时间都会触发 subscription.updated.pause_schedule_set。实际恢复时才会触发 subscription.resumed。
订阅未暂停时返回 90100259。时间超出允许的预约范围时返回 90100258,错误消息中会给出本次可选的 UTC 时间范围。请求头
请求体
application/json
响应
Updated subscription on success. Check the business code in the response.