Pause, Resume and Cancel Subscription
Modify subscription status to pause, resume, or cancel. Use the status parameter to control the operation type and include relevant parameters based on the target status.
subscriptions.write
scope.Authorizations
Bearer authentication header in the format `Bearer <token>`, where `<token>` is your authentication token.
Headers
Merchant account ID for this request.
""default""
Path Parameters
Unique identifier of the subscription to modify.
"sub_1234567890abcdef"
Body
application/jsonTarget status of the subscription.
"paused"
"active"
"cancelled"
How to handle unpaid invoices when pausing: mark_uncollectible, keep_as_draft, void.
"mark_uncollectible"
"mark_uncollectible"
"keep_as_draft"
"void"
Automatic resume time (ISO 8601 format).
"2024-03-01T00:00:00Z"
Reason for the status change.
"Customer requested temporary pause"
"Payment failed"
"Customer request"
Billing cycle anchor when resuming: unchanged, now.
"unchanged"
"unchanged"
"now"
Proration behavior when resuming: create_prorations, none.
"create_prorations"
"create_prorations"
"none"
Whether to cancel at the end of the current period.
false
"false"
"true"
Reason for cancellation.
"customer_request"
"payment_failed"
"service_discontinued"
"downgrade"
"other"
Whether to prorate refund for unused portion.
false
"true"
"false"
Custom metadata related to status changes.
"{"cancelled_by": "customer", "feedback": "switching_to_competitor"}"
Response
Successful Response
Unique subscription identifier.
"sub_1234567890abcdef"
Object type, always "subscription".
"subscription"
Current subscription status.
"paused"
"active"
"cancelled"
"failed"
Pause configuration details (when status is paused).
Time when subscription was paused (if applicable).
"2024-01-20T14:22:00Z"
"null"
Time when subscription was resumed (if applicable).
"2024-02-20T10:15:00Z"
"null"
Time when subscription was canceled (if applicable).
"2024-01-20T14:22:00Z"
"null"
Cancellation details (when status is cancelled).
Time when subscription ended (if cancelled).
"2024-01-20T14:22:00Z"
"null"
Next billing date (null when paused/cancelled).
"2024-02-20"
"null"
Customer information with generated ID.
Subscription plan details.
Payment method details.
Current billing period start time.
"2024-01-15T10:30:00Z"
Current billing period end time.
"2024-02-15T10:30:00Z"
Custom metadata.
"{}"
Whether this is a production mode subscription.
"false"
curl --request POST \--url https://api.efundpay.com/v4/subscriptions/sub_1234567890abcdef/status \--header 'Authorization: Bearer <token>' \--header 'x-merchant-account-id: <x-merchant-account-id>' \--header 'Content-Type: application/json' \--data '{"status": "paused","pause_behavior": "mark_uncollectible","resume_at": "2024-03-01T00:00:00Z","reason": "Customer requested temporary pause"}'
{"id": "sub_1234567890abcdef","object": "subscription","status": "paused","pause_collection": {"behavior": "mark_uncollectible","resume_at": "2024-03-01T00:00:00Z"},"paused_at": "2024-01-20T14:22:00Z","customer": {"id": "cus_abc123","display_name": "John Doe","external_identifier": "customer-12345","first_name": "John","last_name": "Doe","email_address": "john@example.com","phone_number": "+1234567890","account_number": "123456789"},"plan": {"name": "Basic Monthly","currency": "USD","amount": 1000,"interval": "month","trial_period_days": 14,"billing_cycle_anchor": "immediate"},"payment_method": {"token_id": "tok_a1b2c3d4","type": "card","card": {"number": "4111111111111111","expiration_date": "12/27","security_code": "123"}},"current_period_start": "2024-01-15T10:30:00Z","current_period_end": "2024-02-15T10:30:00Z","next_billing_date": null,"livemode": false}