# Resume a subscription Building with an AI agent? Start at https://docs.payme.io/agents.md - Sandbox: `PATCH https://sandbox.payme.io/api/subscriptions/{sub_payme_id}/resume` - Production: `PATCH https://live.payme.io/api/subscriptions/{sub_payme_id}/resume` ## Credentials - Header `PayMe-Merchant-Key` (API key) - Request body field `seller_payme_id` (optional): The seller's MPL, instead of the `PayMe-Merchant-Key` header. - Request body field `payme_client_key` (optional): Partners only: your partner key, instead of the `PayMe-Partner-Key` header. ## Overview Resumes a paused subscription (status `3`) and sets it to status `2` (Active). No callback is sent. Iterations skipped while the subscription was paused aren't charged; the next charge runs at `sub_next_date`. Example: `PATCH https://sandbox.payme.io/api/subscriptions/SUB16885-68336QPL-UQSSS1CC-SYKXI53N/resume` with the header `PayMe-Merchant-Key: MPLDEMO-MPLDEMO-MPLDEMO-1234567`. ## Authentication Send the seller's MPL in the `PayMe-Merchant-Key` header, or as `seller_payme_id` in a JSON body. Partners also send `payme_client_key`, in the body or the `PayMe-Partner-Key` header. The subscription must belong to the seller (error `370`). ## Errors Errors return `status_code` `1` with HTTP 500 unless the table says otherwise. | HTTP | Code | When | |---|---|---| | 500 | `1` | A required field is missing, or no credential was sent. `status_additional_info` names the field. | | 500 | `251` | The `seller_payme_id` matches no seller. | | 500 | `370` | The subscription belongs to another seller. | | 500 | `371` | No subscription has this `sub_payme_id`. | | 400 | `305` | The subscription isn't paused. `status_additional_info` gives its current status. | ## Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `PayMe-Merchant-Key` | header | string | yes | The seller's MPL. Or send it as `seller_payme_id` in a JSON body instead. | | `sub_payme_id` | path | string | yes | The subscription to resume (`sub_payme_id`, for example `SUB16885-68336QPL-UQSSS1CC-SYKXI53N`). | ## Request body Content type: `application/json` Optional. Use it instead of the headers. | Field | Type | Required | Description | | --- | --- | --- | --- | | `seller_payme_id` | string | no | The seller's MPL, instead of the `PayMe-Merchant-Key` header. | | `payme_client_key` | string | no | Partners only: your partner key, instead of the `PayMe-Partner-Key` header. | ### Request example No example is documented; this template is generated from the fields — replace the placeholder values. ```json { "seller_payme_id": "", "payme_client_key": "" } ``` ## Code samples ### curl ```bash curl -X PATCH 'https://sandbox.payme.io/api/subscriptions//resume' \ -H 'Content-Type: application/json' \ -H 'PayMe-Merchant-Key: ' \ --data-raw '{}' ``` ### Node.js ```javascript const response = await fetch("https://sandbox.payme.io/api/subscriptions//resume", { method: "PATCH", headers: { "Content-Type": "application/json", "PayMe-Merchant-Key": "", }, body: JSON.stringify({}), }); console.log(await response.text()); ``` ### Python ```python import requests response = requests.patch( "https://sandbox.payme.io/api/subscriptions//resume", headers={ "PayMe-Merchant-Key": "", }, json={}, ) print(response.text) ``` ### PHP ```php /resume'); curl_setopt_array($ch, [ CURLOPT_CUSTOMREQUEST => 'PATCH', CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'PayMe-Merchant-Key: ', ], CURLOPT_POSTFIELDS => $body, ]); $response = curl_exec($ch); curl_close($ch); echo $response; ``` ## Responses ### 200 — The subscription is active again. (success) | Field | Type | Description | | --- | --- | --- | | `status_code` | integer | `0` on success. | | `payme_status` | string | `success`. | | `status_error_code` | integer | `0` on success. | | `seller_payme_id` | string | The seller's MPL. | | `seller_id` | string | The partner's own reference for the seller, if the partner set one. Otherwise `null`. | | `sub_payme_id` | string | PayMe's subscription ID (`SUB…`). Use it in every other subscription call. | | `sub_payme_code` | integer | PayMe's numeric subscription ID. | | `subscription_id` | string | Your own reference, as sent when the subscription was created. `null` if you didn't send one. | | `sub_created` | string | When the subscription was created, `YYYY-MM-DD HH:MM:SS`. | | `sub_start_date` | string | Date of the first charge, `YYYY-MM-DD HH:MM:SS`. | | `sub_prev_date` | string | When the last successful charge ran. `null` until the first charge. | | `sub_next_date` | string | When the next charge is due. Ignore it on a canceled or completed subscription. | | `sub_status` | integer | Current status. See [Subscription statuses](/payments/codes-statuses/subscription-statuses). | | `sub_iteration_type` | integer | Billing interval. See [Subscription iteration types](/payments/codes-statuses/subscription-iteration-types). | | `sub_currency` | string | ISO 4217 currency code, e.g. `ILS`. | | `sub_price` | integer | Price of one iteration, in minor units (`5000` = 50.00). | | `sub_description` | string | What the buyer is paying for. | | `sub_iterations` | integer | Total number of iterations. `-1` means unlimited. | | `sub_iterations_completed` | integer | Iterations charged successfully. | | `sub_iterations_skipped` | integer | Iterations skipped while the subscription was paused. They are never charged. | | `sub_iterations_left` | integer | `sub_iterations` minus completed and skipped iterations. `-1` when unlimited. | | `sub_paid` | boolean | `true` once a card (buyer token) is attached to the subscription. It does not mean the current iteration was charged. | | `sub_error_text` | string | The last failure, pause or cancel reason. `null` if there is none. Reasons that PayMe writes are in Hebrew. | | `sub_payment_date` | string | Returned only when a card is attached: when the card was attached. | | `buyer_card_mask` | string | Returned only when a card is attached: the masked card number. | | `buyer_card_exp` | string | Returned only when a card is attached: card expiry, `MMYY`. | | `buyer_name` | string | Returned only when a card is attached: the card holder's name. | | `buyer_email` | string | Returned only when a card is attached: the card holder's email. | | `buyer_phone` | string | Returned only when a card is attached: the card holder's phone, or `null`. | | `buyer_social_id` | string | Returned only when a card is attached: the card holder's national ID, or `null`. | ```json { "status_code": 0, "payme_status": "success", "status_error_code": 0, "seller_payme_id": "MPLDEMO-MPLDEMO-MPLDEMO-1234567", "seller_id": null, "sub_payme_id": "SUB16885-68336QPL-UQSSS1CC-SYKXI53N", "sub_payme_code": 477004, "subscription_id": "order-1001", "sub_created": "2026-11-09 10:15:00", "sub_start_date": "2026-12-01 00:00:00", "sub_prev_date": null, "sub_next_date": "2026-12-01 00:00:00", "sub_status": 2, "sub_iteration_type": 3, "sub_currency": "ILS", "sub_price": 5000, "sub_description": "Monthly plan", "sub_iterations": 12, "sub_iterations_completed": 0, "sub_iterations_skipped": 0, "sub_iterations_left": 12, "sub_paid": true, "sub_error_text": "הושהה על ידי המשתמש בתאריך 09/11/2026 10:30:00", "sub_payment_date": "2026-11-09 10:20:00", "buyer_card_mask": "532610******5846", "buyer_card_exp": "1230", "buyer_name": "Israel Israeli", "buyer_email": "buyer@example.com", "buyer_phone": null, "buyer_social_id": null } ``` ### 400 — The subscription isn't paused (`305`). (error) | Field | Type | Description | | --- | --- | --- | | `status_code` | integer | `1` on failure. | | `status_error_details` | string | What went wrong, in the language you asked for (Hebrew by default). | | `status_additional_info` | string | The field or value concerned. Can be `null`. | | `status_error_code` | integer | PayMe error code. See the error table above and [Errors](/payments/getting-started/errors). | | `session` | string | PayMe session ID. Quote it when you contact support. | ```json { "status_code": 1, "status_error_details": "Cannot perform action due to an incorrect status", "status_additional_info": "Subscription status: active", "status_error_code": 305, "session": "FhT3aXe7" } ``` ### 500 — The request was refused. See the error table. (error) | Field | Type | Description | | --- | --- | --- | | `status_code` | integer | `1` on failure. | | `status_error_details` | string | What went wrong, in the language you asked for (Hebrew by default). | | `status_additional_info` | string | The field or value concerned. Can be `null`. | | `status_error_code` | integer | PayMe error code. See the error table above and [Errors](/payments/getting-started/errors). | | `session` | string | PayMe session ID. Quote it when you contact support. | ```json { "status_code": 1, "status_error_details": "Subscription was not found", "status_additional_info": null, "status_error_code": 371, "session": "FhT3aXe7" } ```