---
agentTools:
  projectIndex: https://uspacy.readme.io/llms.txt
---

# Create requisite

Creates a new requisite (company legal details) based on a template.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "CRM service",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://{domain}.uspacy.ua",
      "description": "Ukrainian server"
    },
    {
      "url": "https://{domain}.uspacy.eu",
      "description": "EU server"
    },
    {
      "url": "https://{domain}.uspacy.com.br",
      "description": "Brazilian server"
    },
    {
      "url": "https://{domain}.uspacy.com",
      "description": "International server"
    }
  ],
  "tags": [
    {
      "name": "requisites",
      "description": "Requisites, bank requisites, and templates"
    }
  ],
  "paths": {
    "/crm/v1/requisites": {
      "post": {
        "tags": [
          "requisites"
        ],
        "summary": "Create requisite",
        "description": "Creates a new requisite (company legal details) based on a template.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRequisite"
              },
              "example": {
                "name": "Acme Corp requisite",
                "template_id": 1,
                "is_basic": true,
                "fields": {
                  "company_name": "Acme Corporation",
                  "tax_id": "12345678",
                  "legal_address": "123 Business Ave, Kyiv"
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Requisite"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "responses": {
      "UnauthorizedError": {
        "description": "Access token is missing or invalid"
      },
      "ValidationError": {
        "description": "Validation error response",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "errors": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "example": {
                    "field_name": [
                      "The field_name field is required."
                    ]
                  }
                },
                "status": {
                  "type": "boolean",
                  "example": true
                }
              }
            }
          }
        }
      }
    },
    "schemas": {
      "Field": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Source"
          },
          "code": {
            "type": "string",
            "example": "source"
          },
          "required": {
            "type": "boolean",
            "example": false
          },
          "editable": {
            "type": "boolean",
            "example": true
          },
          "show": {
            "type": "boolean",
            "example": true
          },
          "hidden": {
            "type": "boolean",
            "example": false
          },
          "multiple": {
            "type": "boolean",
            "example": false
          },
          "fieldSectionId": {
            "type": "integer",
            "example": 11
          },
          "default_value": {
            "type": "string",
            "example": "value"
          },
          "tooltip": {
            "type": "string",
            "example": "example"
          },
          "type": {
            "type": "string",
            "example": "entity_reference"
          },
          "entity_reference_id": {
            "type": "integer",
            "example": 123
          },
          "sort": {
            "type": "integer",
            "example": 90
          }
        }
      },
      "Requisite": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "seal_picture": {
            "type": "number"
          },
          "sign_picture": {
            "type": "number"
          },
          "template_name": {
            "type": "string"
          },
          "references_relations": {
            "type": "array",
            "items": {
              "type": "number",
              "description": "Id of parent entity where requisite attach to child entity"
            }
          },
          "is_basic": {
            "type": "boolean"
          },
          "id": {
            "type": "number"
          },
          "template_id": {
            "type": "integer"
          },
          "region": {
            "$ref": "#/components/schemas/Region"
          },
          "fields": {
            "description": "Fields list",
            "type": "object",
            "properties": {
              "list": {
                "type": "array",
                "items": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Field"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "datetime",
                            "string",
                            "integer",
                            "boolean",
                            "file"
                          ]
                        }
                      }
                    }
                  ]
                }
              },
              "values": {
                "type": "object",
                "properties": {
                  "field_code": {
                    "enum": [
                      "string",
                      "array",
                      "object"
                    ],
                    "description": "Field code => field value"
                  }
                }
              }
            }
          },
          "bank_requisites": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BankRequisite"
            }
          }
        }
      },
      "CreateRequisite": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "template_id": {
            "type": "integer"
          },
          "is_basic": {
            "type": "boolean"
          },
          "fields": {
            "type": "object",
            "properties": {
              "field_code": {
                "enum": [
                  "string",
                  "array",
                  "object"
                ],
                "description": "Field code => field value"
              }
            }
          },
          "bank_requisites": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BankRequisite"
            }
          }
        }
      },
      "Region": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "image": {
            "type": "number"
          },
          "id": {
            "type": "number"
          }
        }
      },
      "BankRequisite": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "created_by": {
            "type": "number"
          },
          "requisite_id": {
            "type": "number",
            "required": true
          },
          "name": {
            "type": "string"
          },
          "is_basic": {
            "type": "boolean"
          },
          "fields": {
            "type": "object",
            "properties": {
              "list": {
                "type": "array",
                "items": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Field"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "string"
                          ]
                        }
                      }
                    }
                  ]
                }
              },
              "values": {
                "type": "object",
                "properties": {
                  "field_code": {
                    "enum": [
                      "string",
                      "array",
                      "object"
                    ],
                    "description": "Field code => field value"
                  }
                }
              }
            }
          },
          "references_relations": {
            "type": "array",
            "items": {
              "type": "number",
              "description": "Id of parent entity where requisite attach to child entity"
            }
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 105,
      "1": 145,
      "2": 108,
      "3": 28,
      "4": 165,
      "5": 162,
      "6": 20,
      "7": 148,
      "8": 43,
      "9": 242,
      "10": 235,
      "11": 56
    }
  }
}
```