Add prorated plan to stores

Overview

Assign a plan to one or more stores for the current month. For each store it closes any active/expired store plans without an issued next-invoice, opens a new active store plan. It also creates or updates the CompanyPlan pointer for each affected account and fires a planChanged billing webhook.

Prerequisites

  • A bearer token in the Authorization header.

Base URL

EnvironmentURL
Productionhttps://production-api.shoutaboutus.com
Developmenthttps://development-api.shoutaboutus.com

Endpoint

POST /api/v1/account/add-prorated-plan

Authentication

  • Requires a bearer token in the Authorization: Bearer <bearer-token> header.

  • Bearer partner / account token.

  • plan_id must be assigned to the caller's plan-assignment company (company_plans for planAssignmentCompanyId).

  • Every store_ids[] must belong to the caller's hierarchy (an ownership check).

Rate limit

  • No rate limit.

Request body

FieldTypeRequiredDescription
plan_idintegerRequiredMust exist in company_plans for the caller's plan-assignment company. Error message: 'The selected plan is not assigned to your partner account.'
store_idsinteger[]RequiredNon-empty array.
store_ids.*integerRequiredMust be an existing location and in caller's hierarchy (an ownership check).
{
  "plan_id": "<planId>",
  "store_ids": [123, 124]
}

How it works

  • 200{ data: { status: 'success', message } }.
  • 422 — plan not assigned to caller, or a store_id invalid / out of scope.

Response

200 OK · 200

{
  "data": {
    "status": "success",
    "message": "The plan has been updated! The plan amount will be applied to the following month's invoice."
  }
}

422 Validation error · 422

{
  "message": "The selected plan is not assigned to your partner account.",
  "errors": {
    "plan_id": [
      "The selected plan is not assigned to your partner account."
    ]
  }
}

Errors

StatusMeaning
401The bearer token is missing, expired or invalid
422Validation error
500Unexpected server error

Example request

curl --request POST \
  --url "https://production-api.shoutaboutus.com/api/v1/account/add-prorated-plan" \
  --header 'Authorization: Bearer <bearer-token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{"plan_id": "<planId>", "store_ids": [123, 124]}'

Notes

  • The endpoint applies the plan amount to next month's invoice.

Did this page help you?