Set seller billing plan

Credentials

Assign a billing plan to a seller with payer-based activation flow.

Payer modes:

Pending response (payer is seller and no card is on file):

{
  "payload": {
    "status": "pending",
    "message": "Please complete payment to activate plan",
    "creditCardUrl": "<payment_url>"
  }
}

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

{
  "sellerId": "a6a9700f-8571-4f9b-bfae-ba943fb96982",
  "planId": "3d653770-6376-40a5-b98e-17c598f1d7d8",
  "payer": "partner"
}

Code samples

curl

curl -X POST 'https://<partner_domain>.keep.co.il/api/public/plans/activate' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <YOUR_TOKEN>' \
  --data-raw '{
  "sellerId": "a6a9700f-8571-4f9b-bfae-ba943fb96982",
  "planId": "3d653770-6376-40a5-b98e-17c598f1d7d8",
  "payer": "partner"
}'

Node.js

const response = await fetch("https://<partner_domain>.keep.co.il/api/public/plans/activate", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer <YOUR_TOKEN>",
  },
  body: JSON.stringify({
    "sellerId": "a6a9700f-8571-4f9b-bfae-ba943fb96982",
    "planId": "3d653770-6376-40a5-b98e-17c598f1d7d8",
    "payer": "partner"
  }),
});

console.log(await response.text());

Python

import requests

response = requests.post(
    "https://<partner_domain>.keep.co.il/api/public/plans/activate",
    headers={
        "Authorization": "Bearer <YOUR_TOKEN>",
    },
    json={
        "sellerId": "a6a9700f-8571-4f9b-bfae-ba943fb96982",
        "planId": "3d653770-6376-40a5-b98e-17c598f1d7d8",
        "payer": "partner",
    },
)

print(response.text)

PHP

<?php

$body = <<<'BODY'
{
  "sellerId": "a6a9700f-8571-4f9b-bfae-ba943fb96982",
  "planId": "3d653770-6376-40a5-b98e-17c598f1d7d8",
  "payer": "partner"
}
BODY;

$ch = curl_init('https://<partner_domain>.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 <YOUR_TOKEN>',
    ],
    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')
{
  "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
{
  "statusCode": 400,
  "message": [
    "sellerId must be a UUID"
  ],
  "error": "Bad Request"
}

401 — Unauthorized (error)

Field Type Description
statusCode integer
message string
{
  "statusCode": 401,
  "message": "Unauthorized"
}

403 — The seller does not belong to your partner account. Message: Forbidden. Also returned, with the message Forbidden resource, when the access token has no scope this endpoint accepts. (error)

Field Type Description
statusCode integer HTTP status code
message string Error message
error string Error type: Forbidden. Present only with the message Forbidden resource.
{
  "statusCode": 403,
  "message": "Forbidden"
}

422 — Unprocessable Entity (error)

Field Type Description
statusCode integer HTTP status code
message string Error message(s)
error string Error type
{
  "statusCode": 422,
  "message": "Bad seller configuration. Please contact support!",
  "error": "Unprocessable Entity"
}