# Create limit config by account Create a limit configuration for authorizations on the account level. This is the most granular level allowed and can be used to customize a specific account. There can be only one configuration by account. New creation attempts for the same account get a conflict response. This configuration currently supports only the over-limit feature. See the [Over-limit fee](doc:over-limit-fee) guide for more information. # OpenAPI definition ```json { "openapi": "3.1.0", "info": { "title": "Core platform - Balance watcher", "description": "Balance watcher endpoints.", "contact": { "name": "API Support", "url": "https://developers.pismo.io/support/" }, "license": { "name": "Copyright Pismo" }, "version": "1.0.0" }, "servers": [ { "url": "https://sandbox.pismolabs.io/balance-watcher", "description": "Sandbox API server for testing" } ], "tags": [ { "name": "Limit configurations", "description": "Endpoints to support configuration operations" } ], "components": { "parameters": { "AccountIdPathInteger": { "in": "path", "name": "accountId", "schema": { "type": "integer" }, "required": true, "description": "Account ID for this configuration.", "example": 11935782 } }, "schemas": { "ConfigRequest": { "type": "object", "description": "Configuration record request", "properties": { "over_limit": { "$ref": "#/components/schemas/Overlimit" }, "limit_refund": { "$ref": "#/components/schemas/LimitRefund" } } }, "ConfigResponse": { "type": "object", "description": "Configuration record response", "properties": { "over_limit": { "$ref": "#/components/schemas/Overlimit" }, "limit_refund": { "$ref": "#/components/schemas/LimitRefund" } } }, "Error": { "type": "object", "properties": { "code": { "type": "string", "description": "Error code.", "example": "RCAPI-DOMAIN-VIOLATION" }, "message": { "type": "string", "description": "Error description.", "example": "RCAPI domain violation." } } }, "Overlimit": { "type": "object", "description": "Group of configurations related to the over-limit flow", "required": [ "enable" ], "properties": { "enable": { "type": "boolean", "description": "Flag to enable the over-limit feature.", "example": true } } }, "LimitRefund": { "type": "object", "description": "Group of configurations related to the limit refund flow", "required": [ "enable" ], "properties": { "enable": { "type": "boolean", "description": "Flag to enable the limit refund feature.", "example": true } } } }, "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "description": "Account access token. Tokens can expire quickly, which can result in an \"Unauthorized\" error.", "bearerFormat": "JWT" } } }, "security": [ { "BearerAuth": [] } ], "paths": { "/v1/config/account/{accountId}": { "parameters": [ { "$ref": "#/components/parameters/AccountIdPathInteger" } ], "post": { "summary": "Create limit config by account", "description": "Create a limit configuration for authorizations on the account level. \n\nThis is the most granular level allowed and can be used to customize a specific account. There can be only one configuration by account. New creation attempts for the same account get a conflict response.\n\nThis configuration currently supports only the over-limit feature. See the [Over-limit fee](https://developers.pismo.io/pismo-docs/docs/over-limit-fee) guide for more information.\n", "operationId": "post-config-by-account", "tags": [ "Limit configurations" ], "requestBody": { "description": "Create configuration request body", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ConfigRequest" } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ConfigResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "code": "BW0008", "message": "Invalid request." } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "code": "BW0031", "message": "Config creation by account unauthorized." } } } }, "409": { "description": "Conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "code": "BW0032", "message": "Config already exists." } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "code": "BW0007", "message": "An unexpected error happened." } } } } } } } } } ```