Billing
Update assigned plan for an organization
Changes the plan assigned to a customer organization. The change takes effect immediately. The previous subscription is marked as upgraded and a new active subscription is created with the selected plan. If the organization is already on the requested plan, no change is made.
Use the plans endpoint to see available plan slugs and commitment options.
AuthorizationBearer <token>
Long-lived distributor API key scoped to a channel partner on the shared smao instance.
In: header
Path Parameters
organizationIdstring
MongoDB ObjectId of the organization.
Match
^[a-fA-F0-9]{24}$plan
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X PATCH "https://api.smao.ai/api/distributor/v1/organizations/string/plan" \ -H "Content-Type: application/json" \ -d '{ "plan": { "slug": "professional", "commitment": "yearly" } }'{
"status": "success",
"organization": {
"id": "string",
"name": "string",
"industry": "string",
"timezone": "string",
"channelPartner": "acme",
"externalCustomerId": "string",
"externalContractId": "string",
"partnerId": "string",
"ownerEmail": "[email protected]",
"createdAt": "2019-08-24T14:15:22Z",
"plan": {
"id": "string",
"slug": "string",
"name": "string",
"commitment": "none",
"currency": "string",
"baseFee": 0
}
}
}{
"status": "error",
"errorCode": "INVALID_DATE_RANGE",
"message": "from and to must be valid YYYY-MM-DD values"
}{
"status": "error",
"errorCode": "INVALID_DATE_RANGE",
"message": "from and to must be valid YYYY-MM-DD values"
}{
"status": "error",
"errorCode": "INVALID_DATE_RANGE",
"message": "from and to must be valid YYYY-MM-DD values"
}{
"status": "error",
"errorCode": "INVALID_DATE_RANGE",
"message": "from and to must be valid YYYY-MM-DD values"
}{
"status": "error",
"errorCode": "RATE_LIMITED",
"message": "Too many requests for this API key."
}{
"status": "error",
"errorCode": "INVALID_DATE_RANGE",
"message": "from and to must be valid YYYY-MM-DD values"
}{
"status": "error",
"errorCode": "RATE_LIMIT_UNAVAILABLE",
"message": "Rate limit storage is unavailable. Try again shortly."
}