# Set seller billing plan Building with an AI agent? Start at https://docs.payme.io/agents.md - Sandbox: your partner domain on the Keep sandbox: `POST https://.keep.co.il/api/public/plans/activate` - Production: your partner domain: `POST https://.keep.co.il/api/public/plans/activate` ## Credentials - Header `Authorization: Bearer ` Assign a billing plan to a seller with payer-based activation flow. **Payer modes:** - `partner` — No credit card is required. The plan is normally activated at once. It is scheduled instead of activated when the seller is on a free plan within the trial or the sign-up month, and when a no-cost plan is chosen on days 20–31 of a month; the response is still `activated`, and the plan takes effect at the scheduled date. - `seller` — If the seller already has a credit card on file, the plan is activated immediately. If not, a credit card URL is returned and the plan activates once the seller completes payment. **Pending response** (`payer` is `seller` and no card is on file): ```json { "payload": { "status": "pending", "message": "Please complete payment to activate plan", "creditCardUrl": "" } } ``` ## Parameters This endpoint takes no path, query or header parameters. ## Request body Content type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `sellerId` | string | yes | Seller UUID | | `planId` | string | yes | Plan UUID, from Get available plans | | `payer` | string | yes | Who pays for the plan. 'partner' = immediate activation, 'seller' = may require credit card. Allowed values: `partner`, `seller`. | ### Request example ```json { "sellerId": "a6a9700f-8571-4f9b-bfae-ba943fb96982", "planId": "3d653770-6376-40a5-b98e-17c598f1d7d8", "payer": "partner" } ``` ## Code samples ### curl ```bash curl -X POST 'https://.keep.co.il/api/public/plans/activate' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ' \ --data-raw '{ "sellerId": "a6a9700f-8571-4f9b-bfae-ba943fb96982", "planId": "3d653770-6376-40a5-b98e-17c598f1d7d8", "payer": "partner" }' ``` ### Node.js ```javascript const response = await fetch("https://.keep.co.il/api/public/plans/activate", { method: "POST", headers: { "Content-Type": "application/json", "Authorization": "Bearer ", }, body: JSON.stringify({ "sellerId": "a6a9700f-8571-4f9b-bfae-ba943fb96982", "planId": "3d653770-6376-40a5-b98e-17c598f1d7d8", "payer": "partner" }), }); console.log(await response.text()); ``` ### Python ```python import requests response = requests.post( "https://.keep.co.il/api/public/plans/activate", headers={ "Authorization": "Bearer ", }, json={ "sellerId": "a6a9700f-8571-4f9b-bfae-ba943fb96982", "planId": "3d653770-6376-40a5-b98e-17c598f1d7d8", "payer": "partner", }, ) print(response.text) ``` ### PHP ```php .keep.co.il/api/public/plans/activate'); curl_setopt_array($ch, [ CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'Authorization: Bearer ', ], CURLOPT_POSTFIELDS => $body, ]); $response = curl_exec($ch); curl_close($ch); echo $response; ``` ## Responses ### 201 — Plan set successfully (success) | Field | Type | Description | | --- | --- | --- | | `payload` | object | | | `payload.status` | string | 'activated' when plan is active immediately, 'pending' when seller must complete payment first. | | `payload.message` | string | Human-readable message (present when status is 'pending') | | `payload.creditCardUrl` | string | URL for seller to submit credit card details (present when status is 'pending') | ```json { "payload": { "status": "activated" } } ``` ### 400 — Bad Request. Returned for validation errors, and with the message `Bad seller identifier` when the seller is unknown. (error) | Field | Type | Description | | --- | --- | --- | | `statusCode` | integer | HTTP status code | | `message` | string | Error message(s) | | `error` | string | Error type | ```json { "statusCode": 400, "message": [ "Validation failed" ], "error": "Bad Request" } ``` ### 401 — Unauthorized (error) | Field | Type | Description | | --- | --- | --- | | `statusCode` | integer | | | `message` | string | | ```json { "statusCode": 401, "message": "Unauthorized" } ``` ### 403 — The seller does not belong to your partner account (error) ### 422 — Unprocessable Entity (error) | Field | Type | Description | | --- | --- | --- | | `statusCode` | integer | HTTP status code | | `message` | string | Error message(s) | | `error` | string | Error type | ```json { "statusCode": 422, "message": "Bad seller configuration. Please contact support!", "error": "Unprocessable Entity" } ```