52 lines
1.2 KiB
TypeScript
52 lines
1.2 KiB
TypeScript
import {
|
|
CreateBalanceParamsV0Schema,
|
|
ExtUpdateBalanceParamsV0Schema,
|
|
SuccessResponseSchema,
|
|
} from "@autumn/shared";
|
|
import type { ZodOpenApiPathsObject } from "zod-openapi";
|
|
|
|
export const balancesOpenApi: ZodOpenApiPathsObject = {
|
|
"/balances/update": {
|
|
post: {
|
|
summary: "Update Balance",
|
|
description:
|
|
"Update or set the balance or usage for a specific feature for a customer. Either current_balance or usage must be provided, but not both.",
|
|
tags: ["balances"],
|
|
requestBody: {
|
|
content: {
|
|
"application/json": { schema: ExtUpdateBalanceParamsV0Schema },
|
|
},
|
|
},
|
|
responses: {
|
|
"200": {
|
|
description: "Balance updated successfully",
|
|
content: {
|
|
"application/json": { schema: SuccessResponseSchema },
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
"/balances/create": {
|
|
post: {
|
|
summary: "Create Balance",
|
|
description:
|
|
"Create a new balance for a specific feature for a customer.",
|
|
tags: ["balances"],
|
|
requestBody: {
|
|
content: {
|
|
"application/json": { schema: CreateBalanceParamsV0Schema },
|
|
},
|
|
},
|
|
responses: {
|
|
"200": {
|
|
description: "Balance created successfully",
|
|
content: {
|
|
"application/json": { schema: SuccessResponseSchema },
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|