# Resume Subscription POST https://app.paymentkit.com/api/{account_id}/subscriptions/{subscription_id}/resume Resume a paused subscription. Clears pause fields (paused_at, resumes_at) and transitions subscription back to: - TRIALING: If trial period hasn't expired - ACTIVE: Otherwise Emits `subscription.resumed` webhook event with: - resumed_at: When the subscription was resumed - new_state: The state it transitioned to (active or trialing) When from_workflow=true (Restate calls): - Returns ResumeSubscriptionResponse with status field - Returns "skipped" if subscription is not paused When from_workflow=false (public API calls): - Returns SubscriptionResponse Works for User, API Key, and Restate workflow authentication. Account access is automatically validated via endpoint dependency. Reference: https://docs.paymentkit.com/api-reference/api-reference/subscriptions/resume-subscription ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: Core API version: 1.0.0 paths: /api/{account_id}/subscriptions/{subscription_id}/resume: post: operationId: resume-subscription summary: Resume Subscription description: >- Resume a paused subscription. Clears pause fields (paused_at, resumes_at) and transitions subscription back to: - TRIALING: If trial period hasn't expired - ACTIVE: Otherwise Emits `subscription.resumed` webhook event with: - resumed_at: When the subscription was resumed - new_state: The state it transitioned to (active or trialing) When from_workflow=true (Restate calls): - Returns ResumeSubscriptionResponse with status field - Returns "skipped" if subscription is not paused When from_workflow=false (public API calls): - Returns SubscriptionResponse Works for User, API Key, and Restate workflow authentication. Account access is automatically validated via endpoint dependency. tags: - subpackage_subscriptions parameters: - name: subscription_id in: path required: true schema: type: string - name: account_id in: path required: true schema: type: string - name: from_workflow in: query required: false schema: type: boolean default: false - name: Authorization in: header description: Bearer authentication required: true schema: type: string - name: X-Restate-Secret-Key in: header required: false schema: type: - string - 'null' responses: '200': description: Successful Response content: application/json: schema: $ref: >- #/components/schemas/subscriptions_resume_subscription_Response_200 '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' servers: - url: https://app.paymentkit.com - url: https://staging.paymentkit.com components: schemas: SubscriptionState: type: string enum: - incomplete - trialing - scheduled - active - paused - past_due - cancelled title: SubscriptionState CurrencyCode: type: string enum: - aed - afn - all - amd - ang - aoa - ars - aud - awg - azn - bam - bbd - bdt - bgn - bhd - bif - bmd - bnd - bob - brl - bsd - btn - bwp - byn - bzd - cad - cdf - chf - clp - cny - cop - crc - cuc - cup - cve - czk - djf - dkk - dop - dzd - egp - ern - etb - eur - fjd - fkp - gbp - gel - ghs - gip - gmd - gnf - gtq - gyd - hkd - hnl - hrk - htg - huf - idr - ils - inr - iqd - irr - isk - jmd - jod - jpy - kes - kgs - khr - kmf - kpw - krw - kwd - kyd - kzt - lak - lbp - lkr - lrd - lsl - lyd - mad - mdl - mga - mkd - mmk - mnt - mop - mru - mur - mvr - mwk - mxn - myr - mzn - nad - ngn - nio - nok - npr - nzd - omr - pab - pen - pgk - php - pkr - pln - pyg - qar - ron - rsd - rub - rwf - sar - sbd - scr - sdg - sek - sgd - shp - sle - sos - srd - ssp - stn - svc - syp - szl - thb - tjs - tmt - tnd - top - try - ttd - twd - tzs - uah - ugx - usd - uyu - uzs - ves - vnd - vuv - wst - xaf - xcd - xof - xpf - yer - zar - zmw - zwl description: ISO 4217 currency codes. title: CurrencyCode TierAmountInfoMode: type: string enum: - volume - graduated description: 'Pricing mode: ''volume'' or ''graduated''' title: TierAmountInfoMode TierAmountAtom: type: object properties: units_upto: type: - integer - 'null' description: Upper limit for this tier. Use null for infinity (last tier) unit_amount_atom: type: integer description: Price per unit in this tier (in atomic units) flat_amount_atom: type: integer default: 0 description: Flat fee for this tier (in atomic units) required: - unit_amount_atom description: Individual tier configuration for tiered pricing. title: TierAmountAtom TierAmountInfo: type: object properties: mode: $ref: '#/components/schemas/TierAmountInfoMode' description: 'Pricing mode: ''volume'' or ''graduated''' amount_atoms: type: array items: $ref: '#/components/schemas/TierAmountAtom' description: List of pricing tiers required: - mode - amount_atoms description: Tiered pricing configuration. title: TierAmountInfo Price: type: object properties: id: type: string account_id: type: string product_id: type: string product_name: type: - string - 'null' product_description: type: - string - 'null' name: type: - string - 'null' unit_amount_atom: type: - integer - 'null' currency: $ref: '#/components/schemas/CurrencyCode' is_active: type: boolean unit_label: type: - string - 'null' pricing_type: type: string recurring_interval: type: - string - 'null' recurring_interval_count: type: - integer - 'null' auto_renew: type: - boolean - 'null' contract_term_multiple: type: - integer - 'null' trial_days: type: integer usage_type: type: string metered_id: type: - string - 'null' billing_scheme: type: string tier_amount_info: oneOf: - $ref: '#/components/schemas/TierAmountInfo' - type: 'null' prerequisite_price_ids: type: - array - 'null' items: type: string exclusive_customer_ids: type: - array - 'null' items: type: string metadata: type: - object - 'null' additionalProperties: description: Any type custom_fields: type: - object - 'null' additionalProperties: description: Any type description: >- Custom field values. Only included when expand=custom_fields is specified. quantity_divisor: type: integer default: 1 created_at: type: string format: date-time updated_at: type: string format: date-time required: - id - account_id - product_id - name - unit_amount_atom - currency - is_active - unit_label - pricing_type - recurring_interval - recurring_interval_count - auto_renew - contract_term_multiple - trial_days - usage_type - metered_id - billing_scheme - tier_amount_info - prerequisite_price_ids - exclusive_customer_ids - metadata - created_at - updated_at title: Price SubscriptionAddon: type: object properties: price: $ref: '#/components/schemas/Price' subscription_item_id: type: - string - 'null' quantity: type: - integer - 'null' required: - price description: An addon — either currently subscribed or available to add. title: SubscriptionAddon SubscriptionItemResponse: type: object properties: id: type: string price: $ref: '#/components/schemas/Price' quantity: type: integer is_active: type: boolean default: true start_at_end: type: boolean default: false drop_at_end: type: boolean default: false product_name: type: string product_description: type: - string - 'null' aggregated_usage: type: - integer - 'null' available_prices: type: - array - 'null' items: $ref: '#/components/schemas/Price' addons: type: - array - 'null' items: $ref: '#/components/schemas/SubscriptionAddon' required: - id - price - quantity - product_name title: SubscriptionItemResponse Address: type: object properties: id: type: string line1: type: - string - 'null' line2: type: - string - 'null' line3: type: - string - 'null' city: type: - string - 'null' state: type: - string - 'null' zip_code: type: - string - 'null' country: type: - string - 'null' required: - id - line1 - line2 - line3 - city - state - zip_code - country title: Address CreditBalance: type: object properties: amount_atom: type: integer description: Credit balance amount in smallest currency unit currency: $ref: '#/components/schemas/CurrencyCode' description: Currency code required: - amount_atom - currency description: Credit balance for a customer. title: CreditBalance TotalSpent: type: object properties: amount_atom: type: integer description: Total spent amount in smallest currency unit currency: $ref: '#/components/schemas/CurrencyCode' description: Currency code required: - amount_atom - currency description: Total amount spent by a customer. title: TotalSpent Customer: type: object properties: id: type: string name: type: - string - 'null' first_name: type: - string - 'null' last_name: type: - string - 'null' email: type: - string - 'null' phone: type: - string - 'null' billing_email: type: - string - 'null' business_name: type: - string - 'null' address: oneOf: - $ref: '#/components/schemas/Address' - type: 'null' shipping_address: oneOf: - $ref: '#/components/schemas/Address' - type: 'null' tax_ids: type: - array - 'null' items: type: string currency: oneOf: - $ref: '#/components/schemas/CurrencyCode' - type: 'null' language: type: - string - 'null' invoice_settings: type: - object - 'null' additionalProperties: description: Any type credit_balance: oneOf: - $ref: '#/components/schemas/CreditBalance' - type: 'null' total_spent: oneOf: - $ref: '#/components/schemas/TotalSpent' - type: 'null' metadata: type: - object - 'null' additionalProperties: description: Any type custom_fields: type: - object - 'null' additionalProperties: description: Any type description: >- Custom field values. Only included when expand=custom_fields is specified. created_at: type: string format: date-time updated_at: type: string format: date-time required: - id - name - first_name - last_name - email - phone - billing_email - business_name - address - shipping_address - tax_ids - currency - language - invoice_settings - credit_balance - total_spent - metadata - created_at - updated_at title: Customer CollectionMethod: type: string enum: - charge_automatically - send_invoice title: CollectionMethod PaymentProviderType: type: string enum: - credit_card - paypal - google_pay - apple_pay description: Type of payment method. title: PaymentProviderType PaymentMethod: type: object properties: id: type: string account_id: type: string customer_id: type: - string - 'null' provider_type: $ref: '#/components/schemas/PaymentProviderType' name: type: string is_active: type: boolean metadata: type: - object - 'null' additionalProperties: description: Any type used_in_subscription: type: boolean default: false created_at: type: string format: date-time updated_at: type: string format: date-time required: - id - account_id - customer_id - provider_type - name - is_active - metadata - created_at - updated_at description: Payment method API response model. title: PaymentMethod DiscountResponse: type: object properties: id: type: string coupon_id: type: string promotion_code_id: type: - string - 'null' attachment_level: type: string customer_id: type: - string - 'null' subscription_id: type: - string - 'null' invoice_id: type: - string - 'null' invoice_item_id: type: - string - 'null' start_date: type: string format: date-time end_date: type: - string - 'null' format: date-time is_active: type: boolean metadata: type: - object - 'null' additionalProperties: description: Any type created_at: type: string format: date-time updated_at: type: string format: date-time required: - id - coupon_id - promotion_code_id - attachment_level - customer_id - subscription_id - invoice_id - invoice_item_id - start_date - end_date - is_active - metadata - created_at - updated_at description: Response schema for discount data. title: DiscountResponse SubscriptionResponse: type: object properties: id: type: string state: $ref: '#/components/schemas/SubscriptionState' currency: $ref: '#/components/schemas/CurrencyCode' description: type: - string - 'null' current_period_start: type: string format: date-time current_period_end: type: string format: date-time trial_start: type: - string - 'null' format: date-time trial_end: type: - string - 'null' format: date-time paused_at: type: - string - 'null' format: date-time resumes_at: type: - string - 'null' format: date-time pause_at_end: type: - boolean - 'null' cancel_at_period_end: type: - boolean - 'null' cancel_at: type: - string - 'null' format: date-time created_at: type: string format: date-time updated_at: type: string format: date-time items: type: array items: $ref: '#/components/schemas/SubscriptionItemResponse' customer: $ref: '#/components/schemas/Customer' collection_method: $ref: '#/components/schemas/CollectionMethod' payment_method: oneOf: - $ref: '#/components/schemas/PaymentMethod' - type: 'null' discount: oneOf: - $ref: '#/components/schemas/DiscountResponse' - type: 'null' last_successful_processor_id: type: - string - 'null' metadata: type: - object - 'null' additionalProperties: description: Any type custom_fields: type: - object - 'null' additionalProperties: description: Any type description: >- Custom field values. Only included when expand=custom_fields is specified. required: - id - state - currency - description - current_period_start - current_period_end - trial_start - trial_end - created_at - updated_at - items - customer - collection_method - payment_method title: SubscriptionResponse ResumeSubscriptionResponse: type: object properties: status: type: string subscription_id: type: - string - 'null' new_state: type: - string - 'null' reason: type: - string - 'null' invoice: type: - object - 'null' additionalProperties: description: Any type required: - status description: |- Response from resume subscription endpoint. Used by Restate workflow when auto-resuming paused subscriptions. status: - "resumed": Subscription transitioned from PAUSED to ACTIVE/TRIALING - "skipped": Not paused or invalid state invoice: Optional invoice created during resume (for prorated billing) title: ResumeSubscriptionResponse subscriptions_resume_subscription_Response_200: oneOf: - $ref: '#/components/schemas/SubscriptionResponse' - $ref: '#/components/schemas/ResumeSubscriptionResponse' title: subscriptions_resume_subscription_Response_200 ValidationErrorLocItems: oneOf: - type: string - type: integer title: ValidationErrorLocItems ValidationError: type: object properties: loc: type: array items: $ref: '#/components/schemas/ValidationErrorLocItems' msg: type: string type: type: string required: - loc - msg - type title: ValidationError HTTPValidationError: type: object properties: detail: type: array items: $ref: '#/components/schemas/ValidationError' title: HTTPValidationError securitySchemes: HTTPBearer: type: http scheme: bearer ``` ## SDK Code Examples ```python import requests url = "https://app.paymentkit.com/api/account_id/subscriptions/subscription_id/resume" payload = {} headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://app.paymentkit.com/api/account_id/subscriptions/subscription_id/resume'; const options = { method: 'POST', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://app.paymentkit.com/api/account_id/subscriptions/subscription_id/resume" payload := strings.NewReader("{}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://app.paymentkit.com/api/account_id/subscriptions/subscription_id/resume") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://app.paymentkit.com/api/account_id/subscriptions/subscription_id/resume") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{}") .asString(); ``` ```php request('POST', 'https://app.paymentkit.com/api/account_id/subscriptions/subscription_id/resume', [ 'body' => '{}', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://app.paymentkit.com/api/account_id/subscriptions/subscription_id/resume"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = [] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://app.paymentkit.com/api/account_id/subscriptions/subscription_id/resume")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```