Subscription
PATCH
/subscriptions/{subscription_id}Update Subscription
Body — UpdateSubscriptionDTO (app/handlers/v1/subscription/request.go:317). All fields optional.
| Field | Notes |
|---|---|
line_items | replace the subscription's items |
default_payment_method_id | pointer string — set to swap default PM |
proration_behavior | create_prorations / none / always_invoice (the last fires a proration invoice synchronously) |
billing_thresholds | re-arm or change {amount_gte, reset_billing_cycle_anchor} |
invoice_settings | {custom_fields, footer, account_tax_ids} |
pending_invoice_item_interval | {interval, interval_count} |
Request
Example
curl -X PATCH 'https://api.paycose.com/api/v1/app1/platform/wallet/subscriptions/{{subscription_id}}' \
-H 'X-Session-Token: {{session_token}}' \
-H 'X-Country: {{country}}' \
-d '{
"line_items": [],
"metadata": {},
"description": "<string>",
"collection_method": "<string>",
"payment_method_types": [
"<string>"
],
"payment_method_providers": [
"<string>"
],
"auto_advance": false,
"due_date": "<RFC3339 timestamp>",
"cancel_at_period_end": false,
"default_payment_method": {
"id": "<string>",
"type": "<string>"
},
"default_payment_method_id": "{{payment_method_id}}",
"proration_behavior": "create_prorations",
"billing_thresholds": null,
"invoice_settings": null,
"pending_invoice_item_interval": null,
"coupon": "<string>",
"trial_end": "<RFC3339 timestamp>",
"trial_settings": {
"end_behavior_missing_payment_method": "<string>"
},
"billing_cycle_anchor": "<RFC3339 timestamp>",
"labels": [
"<string>"
]
}'Headers
| Name | Value |
|---|---|
| X-Session-Token | {{session_token}} |
| X-Country | {{country}} |
Body
| Name | Type | Value |
|---|---|---|
| line_items | array | [0] |
| metadata | object | {…} |
| description | string | <string> |
| collection_method | string | <string> |
| payment_method_types | array | [1] |
| payment_method_providers | array | [1] |
| auto_advance | boolean | false |
| due_date | string | <RFC3339 timestamp> |
| cancel_at_period_end | boolean | false |
| default_payment_method | object | {…} |
| default_payment_method_id | string | {{payment_method_id}} |
| proration_behavior | string | create_prorations |
| billing_thresholds | null | null |
| invoice_settings | null | null |
| pending_invoice_item_interval | null | null |
| coupon | string | <string> |
| trial_end | string | <RFC3339 timestamp> |
| trial_settings | object | {…} |
| billing_cycle_anchor | string | <RFC3339 timestamp> |
| labels | array | [1] |
{
"line_items": [],
"metadata": {},
"description": "<string>",
"collection_method": "<string>",
"payment_method_types": [
"<string>"
],
"payment_method_providers": [
"<string>"
],
"auto_advance": false,
"due_date": "<RFC3339 timestamp>",
"cancel_at_period_end": false,
"default_payment_method": {
"id": "<string>",
"type": "<string>"
},
"default_payment_method_id": "{{payment_method_id}}",
"proration_behavior": "create_prorations",
"billing_thresholds": null,
"invoice_settings": null,
"pending_invoice_item_interval": null,
"coupon": "<string>",
"trial_end": "<RFC3339 timestamp>",
"trial_settings": {
"end_behavior_missing_payment_method": "<string>"
},
"billing_cycle_anchor": "<RFC3339 timestamp>",
"labels": [
"<string>"
]
}Responses
400400 Bad Request
Headers
| Name | Value |
|---|---|
| Content-Type | application/json |
Body
{
"object": "error",
"code": "<string>",
"key": "<string>",
"i18n_key": "<string>",
"message": "<string>",
"request_id": "<string>"
}500500 Internal Server Error
Headers
| Name | Value |
|---|---|
| Content-Type | application/json |
Body
{
"object": "error",
"code": "<string>",
"key": "<string>",
"i18n_key": "<string>",
"message": "<string>",
"request_id": "<string>"
}